📄 cliniccharge.h
字号:
this->btnSearch->Size = System::Drawing::Size(56, 24);
this->btnSearch->TabIndex = 0;
this->btnSearch->Text = S"搜索";
this->btnSearch->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
this->btnSearch->Click += new System::EventHandler(this, btnSearch_Click);
//
// imageList1
//
this->imageList1->ImageSize = System::Drawing::Size(16, 16);
this->imageList1->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer * >(resources->GetObject(S"imageList1.ImageStream")));
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
//
// dgrdPrice
//
this->dgrdPrice->DataMember = S"";
this->dgrdPrice->Dock = System::Windows::Forms::DockStyle::Top;
this->dgrdPrice->HeaderForeColor = System::Drawing::SystemColors::ControlText;
this->dgrdPrice->Location = System::Drawing::Point(0, 128);
this->dgrdPrice->Name = S"dgrdPrice";
this->dgrdPrice->Size = System::Drawing::Size(752, 128);
this->dgrdPrice->TabIndex = 2;
this->dgrdPrice->CurrentCellChanged += new System::EventHandler(this, dgrdPrice_CurrentCellChanged);
//
// groupBox2
//
this->groupBox2->Controls->Add(this->btnReceive);
this->groupBox2->Controls->Add(this->label16);
this->groupBox2->Controls->Add(this->tBoxChange);
this->groupBox2->Controls->Add(this->tBoxReceive);
this->groupBox2->Controls->Add(this->tBoxTotal);
this->groupBox2->Controls->Add(this->label5);
this->groupBox2->Controls->Add(this->label7);
this->groupBox2->Dock = System::Windows::Forms::DockStyle::Bottom;
this->groupBox2->Location = System::Drawing::Point(0, 365);
this->groupBox2->Name = S"groupBox2";
this->groupBox2->Size = System::Drawing::Size(752, 80);
this->groupBox2->TabIndex = 3;
this->groupBox2->TabStop = false;
//
// btnReceive
//
this->btnReceive->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
this->btnReceive->Location = System::Drawing::Point(640, 40);
this->btnReceive->Name = S"btnReceive";
this->btnReceive->Size = System::Drawing::Size(56, 24);
this->btnReceive->TabIndex = 71;
this->btnReceive->Text = S"收款";
this->btnReceive->Click += new System::EventHandler(this, btnReceive_Click);
//
// label16
//
this->label16->Location = System::Drawing::Point(344, 24);
this->label16->Name = S"label16";
this->label16->Size = System::Drawing::Size(56, 11);
this->label16->TabIndex = 66;
this->label16->Text = S"找零";
//
// tBoxChange
//
this->tBoxChange->Location = System::Drawing::Point(344, 40);
this->tBoxChange->Name = S"tBoxChange";
this->tBoxChange->Size = System::Drawing::Size(112, 21);
this->tBoxChange->TabIndex = 70;
this->tBoxChange->Text = S"";
//
// tBoxReceive
//
this->tBoxReceive->Location = System::Drawing::Point(184, 40);
this->tBoxReceive->Name = S"tBoxReceive";
this->tBoxReceive->Size = System::Drawing::Size(120, 21);
this->tBoxReceive->TabIndex = 49;
this->tBoxReceive->Text = S"";
this->tBoxReceive->TextChanged += new System::EventHandler(this, tBoxReceive_TextChanged);
//
// tBoxTotal
//
this->tBoxTotal->Location = System::Drawing::Point(40, 40);
this->tBoxTotal->Name = S"tBoxTotal";
this->tBoxTotal->Size = System::Drawing::Size(104, 21);
this->tBoxTotal->TabIndex = 2;
this->tBoxTotal->Text = S"";
//
// label5
//
this->label5->Location = System::Drawing::Point(40, 24);
this->label5->Name = S"label5";
this->label5->Size = System::Drawing::Size(56, 11);
this->label5->TabIndex = 1;
this->label5->Text = S"合计金额";
//
// label7
//
this->label7->Location = System::Drawing::Point(184, 24);
this->label7->Name = S"label7";
this->label7->Size = System::Drawing::Size(56, 11);
this->label7->TabIndex = 3;
this->label7->Text = S"收款";
//
// dgrdPriceDetail
//
this->dgrdPriceDetail->DataMember = S"";
this->dgrdPriceDetail->Dock = System::Windows::Forms::DockStyle::Fill;
this->dgrdPriceDetail->HeaderForeColor = System::Drawing::SystemColors::ControlText;
this->dgrdPriceDetail->Location = System::Drawing::Point(0, 256);
this->dgrdPriceDetail->Name = S"dgrdPriceDetail";
this->dgrdPriceDetail->Size = System::Drawing::Size(752, 109);
this->dgrdPriceDetail->TabIndex = 4;
//
// ClinicCharge
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->ClientSize = System::Drawing::Size(752, 445);
this->Controls->Add(this->dgrdPriceDetail);
this->Controls->Add(this->dgrdPrice);
this->Controls->Add(this->groupBox2);
this->Controls->Add(this->groupBox1);
this->Name = S"ClinicCharge";
this->Text = S"收费项目";
this->groupBox1->ResumeLayout(false);
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dgrdPrice))->EndInit();
this->groupBox2->ResumeLayout(false);
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dgrdPriceDetail))->EndInit();
this->ResumeLayout(false);
}
private:
//-----------------------设置表格各列的属性-----------------------
void DataGridStateControl()
{
DataGridTableStyle* ts = new DataGridTableStyle();
ts->MappingName = this->ds->Tables->Item[S"门诊划价"]->TableName;
DataGridNoActiveCellColumn* aTextColumn;
ts->AllowSorting = false;
ts->AlternatingBackColor = Color::LightGray;
int numCols = this->ds->Tables->Item[S"门诊划价"]->Columns->Count;
for(int i = 0;i < numCols;i++)
{
aTextColumn = new DataGridNoActiveCellColumn();
aTextColumn->get_TextBox()->Enabled = false;
aTextColumn->MappingName = this->ds->Tables->Item[S"门诊划价"]->Columns->Item[i]->ColumnName;
aTextColumn->HeaderText = this->ds->Tables->Item[S"门诊划价"]->Columns->Item[i]->ColumnName;
aTextColumn->NullText = S"";
aTextColumn->Format = S"D";
ts->GridColumnStyles->Add(aTextColumn);
}
this->dgrdPrice->TableStyles->Add(ts);
ts = new DataGridTableStyle();
ts->MappingName = this->ds->Tables->Item[S"门诊划价明细"]->TableName;
ts->AllowSorting = false;
ts->AlternatingBackColor = Color::LightGray;
numCols = this->ds->Tables->Item[S"门诊划价明细"]->Columns->Count;
for(int i = 0;i < numCols;i++)
{
aTextColumn = new DataGridNoActiveCellColumn();
aTextColumn->get_TextBox()->Enabled = false;
aTextColumn->MappingName = this->ds->Tables->Item[S"门诊划价明细"]->Columns->Item[i]->ColumnName;
aTextColumn->HeaderText = this->ds->Tables->Item[S"门诊划价明细"]->Columns->Item[i]->ColumnName;
aTextColumn->NullText = S"";
aTextColumn->Format = S"D";
ts->GridColumnStyles->Add(aTextColumn);
}
this->dgrdPriceDetail->TableStyles->Add(ts);
}
//按条件查询
private: System::Void btnSearch_Click(System::Object * sender, System::EventArgs * e)
{
String* strID = this->tBoxID->Text->Trim();
String* strName = this->tBoxName->Text->Trim();
String* strStartTime = this->tBoxStartTime->Text->Trim();
String* strEndTime = this->tBoxEndTime->Text->Trim();
String* Filter = S"";
if(String::Compare(strID,String::Empty) != 0)
{
Filter = String::Format(S"{0} AND (编号 LIKE '%{1}%')",Filter,strID);
}
if(String::Compare(strName,String::Empty) != 0)
{
Filter = String::Format(S"{0} AND (姓名 LIKE '%{1}%')",Filter,strName);
}
if(String::Compare(strStartTime,String::Empty) != 0)
{
Filter = String::Format(S"{0} AND (划价时间 >= '{1}')",Filter,strStartTime);
}
if(String::Compare(strEndTime,String::Empty) != 0)
{
Filter = String::Format(S"{0} AND (划价时间 <= '{1}')",Filter,strEndTime);
}
this->ds->Tables->Item[S"门诊划价"]->Clear();
if(String::Compare(Filter,String::Empty) != 0)
{
Filter = Filter->Substring(5,Filter->Length - 5);
//查询门诊划价
this->strSQL = String::Format(S"SELECT 门诊挂号.姓名, 门诊挂号.性别, 门诊划价.编号, 门诊划价.科室, 门诊划价.挂号编号, 门诊划价.医生, 门诊划价.划价时间, 门诊划价.是否收费, 门诊划价.划价员, 门诊划价.收费员, 门诊划价.收费时间, 门诊划价.划价金额, 门诊划价.是否发药, 门诊划价.发药时间, 门诊划价.发药员 FROM 门诊划价 Where 门诊划价.是否收费 = '否' AND {0}INNER JOIN 门诊挂号 ON 门诊划价.编号 = 门诊挂号.编号",Filter);
this->strTableName = S"门诊划价";
this->MyDataBase->SelectDataBase(this->ChargeAdapter,this->ds,this->strSQL,this->strTableName);
this->PriceView->Table = this->ds->Tables->Item[S"门诊划价"];
}
}
//收款
private: System::Void btnReceive_Click(System::Object * sender, System::EventArgs * e)
{
Decimal Total = 0;
Decimal Receive = 0;
Total = System::Convert::ToDecimal(this->tBoxTotal->Text);
Receive = System::Convert::ToDecimal(this->tBoxReceive->Text);
//如果收款比合计金额少不计算
if(Receive < Total)
{
MessageBox::Show("收款不足");
return;
}
int row = this->dgrdPrice->CurrentRowIndex;
String* tempSQL = String::Format(S"Update 门诊划价 Set 是否收费 = '是',收费时间 = '{0}' Where 编号 = '{1}'",System::DateTime::Now.ToString(),this->ds->Tables->Item[S"门诊划价"]->Rows->Item[row]->Item[S"编号"]->ToString());
this->MyDataBase->SQLOperate(tempSQL);
this->ds->Clear();
//查询门诊划价
this->strSQL = S"SELECT 门诊挂号.姓名, 门诊挂号.性别, 门诊划价.编号, 门诊划价.科室, 门诊划价.挂号编号, 门诊划价.医生, 门诊划价.划价时间, 门诊划价.是否收费, 门诊划价.划价员, 门诊划价.收费员, 门诊划价.收费时间, 门诊划价.划价金额, 门诊划价.是否发药, 门诊划价.发药时间, 门诊划价.发药员 FROM 门诊划价 INNER JOIN 门诊挂号 ON 门诊划价.挂号编号 = 门诊挂号.编号 Where 门诊划价.是否收费 = '否' ";
this->strTableName = S"门诊划价";
this->MyDataBase->SelectDataBase(this->ChargeAdapter,this->ds,this->strSQL,this->strTableName);
//查询门诊划价明细
this->strSQL = S"SELECT 门诊划价明细.编号, 门诊划价明细.划价编号, 门诊划价明细.药品编号, 药品资料.名称, 门诊划价明细.单价, 门诊划价明细.数量, 门诊划价明细.金额 FROM 门诊划价明细 INNER JOIN 药品资料 ON 门诊划价明细.药品编号 = 药品资料.编号";
this->strTableName = S"门诊划价明细";
this->MyDataBase->SelectDataBase(this->ChargeAdapter,this->ds,this->strSQL,this->strTableName);
}
//门诊划价明细
private: System::Void dgrdPrice_CurrentCellChanged(System::Object * sender, System::EventArgs * e)
{
int row = this->dgrdPrice->CurrentRowIndex;
this->DetailView->RowFilter = String::Format(S"划价编号 = '{0}'",this->ds->Tables->Item[S"门诊划价"]->Rows->Item[row]->Item[S"编号"]->ToString());
this->tBoxTotal->Text = this->ds->Tables->Item[S"门诊划价"]->Rows->Item[row]->Item[S"划价金额"]->ToString();
this->tBoxReceive->Clear();
this->tBoxChange->Clear();
}
//计算找零金额
private: System::Void tBoxReceive_TextChanged(System::Object * sender, System::EventArgs * e)
{
//无合计金额或收款不计算
if(String::Compare(this->tBoxReceive->Text,String::Empty) == 0 || String::Compare(this->tBoxTotal->Text,String::Empty) == 0)
return;
Decimal Total = 0;
Decimal Receive = 0;
Total = System::Convert::ToDecimal(this->tBoxTotal->Text);
Receive = System::Convert::ToDecimal(this->tBoxReceive->Text);
//如果收款比合计金额少不计算
if(Receive < Total)
return;
Decimal Change = Receive - Total;
this->tBoxChange->Text = Change.ToString();
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -