本文整理汇总了C#中HXCPcClient.Chooser.frmParts.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# frmParts.ShowDialog方法的具体用法?C# frmParts.ShowDialog怎么用?C# frmParts.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HXCPcClient.Chooser.frmParts
的用法示例。
在下文中一共展示了frmParts.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: txtparts_name_ChooserClick
/// <summary> 选择配件名称
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtparts_name_ChooserClick(object sender, EventArgs e)
{
frmParts chooseParts = new frmParts();
chooseParts.ShowDialog();
if (!string.IsNullOrEmpty(chooseParts.PartsID))
{
txtparts_name.Text = chooseParts.PartsName;
}
}
示例2: txtcPartsCode_ChooserClick
//配件选择器
private void txtcPartsCode_ChooserClick(object sender, EventArgs e)
{
frmParts frmPartsChooser = new frmParts();
if (frmPartsChooser.ShowDialog() == DialogResult.OK)
{
txtcPartsCode.Text = frmPartsChooser.PartsCode;
txtPartsName.Caption = frmPartsChooser.PartsName;
}
}
示例3: txtcparts_code_ChooserClick
//配件选择
private void txtcparts_code_ChooserClick(object sender, EventArgs e)
{
frmParts parts = new frmParts();
if (parts.ShowDialog() == DialogResult.OK)
{
txtcparts_code.Text = parts.PartsCode;
txtPartsName.Caption = parts.PartsName;
}
}
示例4: txtPartsCode_ChooserClick
/// <summary>
/// 配件编码选择器事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtPartsCode_ChooserClick(object sender, EventArgs e)
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
txtPartsCode.Text = frmPart.PartsCode;
txtPartsCode.Tag = frmPart.PartsID;
txtPartsName.Caption = frmPart.PartsName;
}
}
示例5: addParts_Click
private void addParts_Click(object sender, EventArgs e)
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
dgvMaterials.CurrentRow.Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.CurrentRow.Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.CurrentRow.Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["default_unit_name"]);
dgvMaterials.CurrentRow.Cells["number"].Value = "1";
dgvMaterials.CurrentRow.Cells["original_price"].Value = CommonCtrl.IsNullToString(dpr["highest_out_price"]);
dgvMaterials.CurrentRow.Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dpr["remark"]);
dgvMaterials.Rows.Add(1);
listMater.Add(CommonCtrl.IsNullToString(dpr["ser_parts_code"]));
}
}
}
示例6: InitControlDataSource
private void InitControlDataSource() //初始化数据字段控件数据
{
try
{
#region 设置控件验证值
txt_repairer_mobile.VerifyTypeName = txt_link_man_mobile.VerifyTypeName = "Phone";
txt_repairer_mobile.ShowError = txt_link_man_mobile.ShowError = true;
txt_customer_postcode.VerifyTypeName = "Postcode";
txt_customer_postcode.ShowError = true;
txt_feedback_num.VerifyTypeName = "Integer";
txt_feedback_num.ShowError = true;
txt_other_money.VerifyTypeName = txt_man_hour_subsidy.VerifyTypeName = txt_ccf.VerifyTypeName = txt_journey_subsidy.VerifyTypeName = txt_maintain_mileage.VerifyTypeName = txt_travel_mileage.VerifyTypeName = "UFloat";
txt_other_money.ShowError = txt_man_hour_subsidy.ShowError = txt_ccf.ShowError = txt_journey_subsidy.ShowError = txt_maintain_mileage.ShowError = txt_travel_mileage.ShowError = true;
#endregion
dtp_goout_back_time.Value = dtp_goout_time.Value = dtp_maintain_time.Value = dtp_parts_buy_time.Value = dtp_repairs_time.Value = dtp_start_work_time.Value = dtp_complete_work_time.Value = DBHelper.GetCurrentTime();
dgv_tb_maintain_three_guaranty_accessory.TableName = "tb_maintain_three_guaranty";
dgv_tb_maintain_three_guaranty_accessory.TableNameKeyValue = TgId;
#region 基础数据
var isSecondStation = DBHelper.GetSingleValue("根据公司编码获取是否为二级站", GlobalStaticObj.CommAccCode, "tb_company", "category", "sap_code = '" + GlobalStaticObj.ServerStationCode+ "'", "");
if (!String.IsNullOrEmpty(isSecondStation))
{
chk_whether_second_station_true.Checked = isSecondStation == "1"; //一级站
chk_whether_second_station_false.Checked = isSecondStation == "2"; //二级站
}
txt_service_station_code.Text = GlobalStaticObj.ServerStationCode; //当前服务站代码
txt_service_station_name.Caption = GlobalStaticObj.ServerStationName; //当前服务站名称
dtp_repairs_time.Value = DateTime.Now; //报修日期(系统默认当前时间)
//txt_service_station_code.ChooserClick += delegate //服务站选择器
//{
// var signInfoChooser = new FormSignInfoChooser();
// var result = signInfoChooser.ShowDialog();
// if (result != DialogResult.OK) return;
// txt_service_station_code.Text = signInfoChooser.SignCode;
// txt_service_station_code.Tag = signInfoChooser.SignId;
// txt_service_station_name.Caption = signInfoChooser.SignName;
//};
CommonCtrl.CmbBindDict(cbo_receipt_type, "bill_type_yt", false); //宇通单据类型
CommonCtrl.CmbBindDict(cbo_cost_type_service_zczg, "cost_type_care_policy_yt", false); //费用类型(政策照顾)
CommonCtrl.BindComboBoxByTable(cbo_product_notice_no, "tb_product_no", "service_code", "activities", false); //产品改进通知
CommonCtrl.CmbBindDict(cbo_whether_go_out, "sys_true_false", false); //是否外出
cbo_whether_go_out.SelectedValue = DbDic2Enum.FALSE; //是否外出(默认选择为否)
CommonCtrl.CmbBindDict(cbo_refit_case, "refit_case", false); //改装情况
cbo_refit_case.SelectedValue = DbDic2Enum.REFIT_CASE_FALSE; //改装请款(默认选择为无改装)
DataSources.BindComBoxDataEnum(cbo_promise_guarantee, typeof(DataSources.EnumYesNo), false); //特殊约定质保
cbo_promise_guarantee.SelectedValue = DataSources.EnumYesNo.NO; //特殊约定质保(默认选择为否)
UIAssistants.BindingServiceStationUser(cbo_approver_name_yt, true, "请选择");
txt_appraiser_name.ChooserClick += delegate //鉴定人选择器
{
var chooser = new frmUsers{ cbo_data_source = { SelectedValue = "1", Enabled = false } };
var result = chooser.ShowDialog();
if (result != DialogResult.OK) return;
if (String.IsNullOrEmpty(chooser.User_Name) || String.IsNullOrEmpty(chooser.CrmId))
{
MessageBoxEx.Show("无效的数据,获取不到用户的CRM信息");
return;
}
//txt_approver_name_yt.Text = chooser.contName;
//txt_approver_name_yt.Tag = chooser.crmId;
txt_appraiser_name.Text = chooser.User_Name;
txt_appraiser_name.Tag = chooser.CrmId;
};
txt_repair_man.ChooserClick += delegate //维修人选择器
{
var chooser = new frmUsers{ cbo_data_source = { SelectedValue = "1", Enabled = false } };
var result = chooser.ShowDialog();
if (result != DialogResult.OK) return;
if (String.IsNullOrEmpty(chooser.User_Name) || String.IsNullOrEmpty(chooser.CrmId))
{
MessageBoxEx.Show("无效的数据,获取不到用户的CRM信息");
return;
}
//txt_approver_name_yt.Text = chooser.contName;
//txt_approver_name_yt.Tag = chooser.crmId;
txt_repair_man.Text = chooser.User_Name;
txt_repair_man.Tag = chooser.CrmId;
};
CommonCtrl.BindComboBoxByTable(cbo_cost_type_service_fwhd, "tb_product_no", "service_code", "activities", false); //费用类型(服务活动) unknow
CommonCtrl.CmbBindDict(cbo_customer_property, "custom_property_yt", false); //客户性质
txt_vehicle_use_corp.ChooserClick += delegate //车辆使用单位选择器
{
var custChooser = new frmCustomerInfo();
var result = custChooser.ShowDialog();
if (result == DialogResult.OK)
{
if (String.IsNullOrEmpty(custChooser.CustomerInfo.CustName) || String.IsNullOrEmpty(custChooser.CustomerInfo.SAPCode))
{
MessageBoxEx.Show("选择的数据不符合使用要求");
return;
//.........这里部分代码省略.........
示例7: dgvMaterials_CellDoubleClick
private void dgvMaterials_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
try
{
int intMrows = e.RowIndex;//当前行的索引
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts_chooser", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
if (listMater.Contains(CommonCtrl.IsNullToString(dpr["ser_parts_code"])))
{
if (MessageBoxEx.Show("已添加此配件,是否继续添加?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
}
for (int i = 0; i <= intMrows; i++)
{
if (string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["parts_code"].Value)))
{
dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["unit"]);
dgvMaterials.Rows[i].Cells["inventory_num"].Value = CommonCtrl.IsNullToString(dpr["paper_count"]);
dgvMaterials.Rows[i].Cells["quantity"].Value = "0.00";
//dgvMaterials.Rows[e.RowIndex].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dpr["brand_name"]);
dgvMaterials.Rows[i].Cells["three_warranty"].Value = "否";
dgvMaterials.Rows[i].Cells["warehouse"].Value = "";
dgvMaterials.Rows[i].Cells["Mdata_source"].Value = CommonCtrl.IsNullToString(dpr["data_source"]);
dgvMaterials.Rows[i].Cells["three_warranty"].ReadOnly = CommonCtrl.IsNullToString(dpr["data_source"]) == Convert.ToInt32(DataSources.EnumDataSources.SELFBUILD).ToString() ? true : false;
dgvMaterials.Rows.Add(1);
break;
}
}
}
}
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
string strPCode = CommonCtrl.IsNullToString(dgvr.Cells["parts_code"].Value);
if (!string.IsNullOrEmpty(strPCode)&&!listMater.Contains(strPCode))
{
listMater.Add(strPCode);
}
}
}
catch (Exception ex)
{
HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex);
}
}
示例8: dgvMaterials_CellDoubleClick
private void dgvMaterials_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (strProjectSattus != "3" && strProjectSattus != "6")
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[e.RowIndex].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["norms"].Value = CommonCtrl.IsNullToString(dpr["model"]);
dgvMaterials.Rows[e.RowIndex].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["default_unit_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value = "1";
dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value = CommonCtrl.IsNullToString(dpr["highest_out_price"]);
string strPzk = !string.IsNullOrEmpty(strMemberPZk) ? strMemberPZk : "10";
//会员折扣
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value = Convert.ToString(Convert.ToDecimal(strPzk) * 10);
string strNum =!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value))?CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value):"0";
string strUMoney = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value.ToString() : "0";
//会员单价
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_price"].Value = Convert.ToString(Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney) * Convert.ToDecimal(dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value) / 10);
dgvMaterials.Rows[e.RowIndex].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[e.RowIndex].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dpr["remark"]);
dgvMaterials.Rows[e.RowIndex].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dpr["v_brand_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["M_Id"].Value = frmPart.PartsID;
dgvMaterials.Rows.Add(1);
}
}
}
}
示例9: addParts_Click
private void addParts_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
string strPCode = CommonCtrl.IsNullToString(dgvr.Cells["parts_code"].Value);
if (!string.IsNullOrEmpty(strPCode))
{
listMater.Add(strPCode);
}
}
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
if (listMater.Contains(CommonCtrl.IsNullToString(dpr["ser_parts_code"])))
{
MessageBoxEx.Show("此配件已存在,请选择其他配件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
dgvMaterials.CurrentRow.Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.CurrentRow.Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.CurrentRow.Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["default_unit_name"]);
dgvMaterials.CurrentRow.Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.CurrentRow.Cells["quantity"].Value = "0";
dgvMaterials.CurrentRow.Cells["unit_price"].Value = CommonCtrl.IsNullToString(dpr["highest_out_price"]);
dgvMaterials.CurrentRow.Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.CurrentRow.Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dpr["v_brand_name"]);
dgvMaterials.Rows.Add(1);
}
}
}
示例10: txtparts_code2_ChooserClick
/// <summary> 选择配件编码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtparts_code2_ChooserClick(object sender, EventArgs e)
{
frmParts chooseParts = new frmParts();
chooseParts.ShowDialog();
this.Refresh();
if (!string.IsNullOrEmpty(chooseParts.PartsID))
{
txtparts_code2.Text = chooseParts.PartsCode;
txtparts_name2.Caption = chooseParts.PartsName;
}
}
示例11: addParts_Click
private void addParts_Click(object sender, EventArgs e)
{
try
{
int intMrows = dgvMaterials.CurrentRow.Index;//当前行的索引
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts_chooser", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
if (listMater.Contains(CommonCtrl.IsNullToString(dpr["ser_parts_code"])))
{
if (MessageBoxEx.Show("已添加此用料,是否继续添加?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
}
for (int i = 0; i <= intMrows; i++)
{
if (string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["parts_code"].Value)))
{
dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dpr["model"]);
dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["unit"]);
dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[i].Cells["quantity"].Value = "1.0";
dgvMaterials.Rows[i].Cells["unit_price"].Value = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dpr["ref_out_price"])) ? Math.Round(Convert.ToDecimal(CommonCtrl.IsNullToString(dpr["ref_out_price"])), 2).ToString("0.00") : "0.00";
string strPzk = !string.IsNullOrEmpty(labMemberLZkS.Text) ? labMemberLZkS.Text.Replace("%", "") : "100";
#region 验证是否存在特殊配件
string strMdic = DBHelper.GetSingleValue("获取特殊配件折扣", "tb_CustomerSer_member_setInfo_parts", "parts_discount", "setInfo_id='" + strSetInfoid + "' and parts_id='" + strPId + "' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", "");
if (!string.IsNullOrEmpty(strMdic))
{
strPzk = strMdic;
}
#endregion
//会员折扣
dgvMaterials.Rows[i].Cells["Mmember_discount"].Value = Convert.ToString(Convert.ToDecimal(strPzk));
string strNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["quantity"].Value)) ? Math.Round(Convert.ToDecimal(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["quantity"].Value)), 2).ToString("0.0") : "0.0";
string strUMoney = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["unit_price"].Value)) ? dgvMaterials.Rows[i].Cells["unit_price"].Value.ToString() : "0.00";
//会员单价
dgvMaterials.Rows[i].Cells["Mmember_price"].Value = Math.Round((Convert.ToDecimal(strUMoney = strUMoney == "" ? "0.00" : strUMoney) * Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["Mmember_discount"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["Mmember_discount"].Value) : "0.00") / 100), 2).ToString("0.00");
dgvMaterials.Rows[i].Cells["sum_money"].Value = Convert.ToString(Convert.ToDecimal(strNum = strNum == "" ? "0" : strNum) * Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney) * Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["Mmember_discount"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[i].Cells["Mmember_discount"].Value) : "0") / 100);
dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dpr["remark"]);
dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonFuncCall.GetCarTypeForMa((CommonCtrl.IsNullToString(dpr["ser_parts_code"])));
dgvMaterials.Rows[i].Cells["parts_id"].Value = frmPart.PartsID;
dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = "否";
dgvMaterials.Rows[i].Cells["Mdata_source"].Value = CommonCtrl.IsNullToString(dpr["data_source"]);
dgvMaterials.Rows[i].Cells["Mthree_warranty"].ReadOnly = CommonCtrl.IsNullToString(dpr["data_source"]) == Convert.ToInt32(DataSources.EnumDataSources.SELFBUILD).ToString() ? true : false;
dcPmoney = 0;
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)))
{
dcPmoney += Convert.ToDecimal(dgvr.Cells["sum_money"].Value);
}
}
txtFSumMoney.Caption = dcPmoney.ToString();
txtFTaxCost.Caption = Math.Round((Convert.ToDecimal(!string.IsNullOrEmpty(txtFSumMoney.Caption.Trim()) ? txtFSumMoney.Caption.Trim() : "0.00") * Convert.ToDecimal(!string.IsNullOrEmpty(txtFTaxRate.Caption.Trim()) ? txtFTaxRate.Caption.Trim() : "0.00") / 100), 2).ToString("0.00");//配件税额
txtFSum.Caption = Math.Round((Convert.ToDecimal(!string.IsNullOrEmpty(txtFSumMoney.Caption.Trim()) ? txtFSumMoney.Caption.Trim() : "0.00") + Convert.ToDecimal(!string.IsNullOrEmpty(txtFTaxCost.Caption.Trim()) ? txtFTaxCost.Caption.Trim() : "0.00")), 2).ToString("0.00");//配件价税合计
txtShouldSum.Caption = Math.Round((Convert.ToDecimal(!string.IsNullOrEmpty(txtHSum.Caption.Trim()) ? txtHSum.Caption.Trim() : "0.00") + Convert.ToDecimal(!string.IsNullOrEmpty(txtFSum.Caption.Trim()) ? txtFSum.Caption.Trim() : "0.00") + Convert.ToDecimal(!string.IsNullOrEmpty(txtOSum.Caption.Trim()) ? txtOSum.Caption.Trim() : "0")), 2).ToString("0.00");//应收总额
strShouldSum = Math.Round(Convert.ToDecimal(txtShouldSum.Caption), 2).ToString("0.00");
txtReceivedSum.Caption = Math.Round((Convert.ToDecimal(!string.IsNullOrEmpty(txtHSum.Caption.Trim()) ? txtHSum.Caption.Trim() : "0.00") + Convert.ToDecimal(!string.IsNullOrEmpty(txtFSum.Caption.Trim()) ? txtFSum.Caption.Trim() : "0.00") + Convert.ToDecimal(!string.IsNullOrEmpty(txtOSum.Caption.Trim()) ? txtOSum.Caption.Trim() : "0") - Convert.ToDecimal(!string.IsNullOrEmpty(txtPrivilegeCost.Caption.Trim()) ? txtPrivilegeCost.Caption.Trim() : "0.00")), 2).ToString("0.00");//实收总额
dgvMaterials.Rows.Add(1);
break;
}
}
}
}
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
string strPCode = CommonCtrl.IsNullToString(dgvr.Cells["parts_code"].Value);
if (!string.IsNullOrEmpty(strPCode) && !listMater.Contains(strPCode))
{
listMater.Add(strPCode);
}
}
}
catch (Exception ex)
{
HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex);
}
}
示例12: dgvMaterials_CellClick
private void dgvMaterials_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.ColumnIndex == 1 || e.ColumnIndex == 2 || e.ColumnIndex == 3)
{
dcPmoney = 0;
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts_chooser", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[e.RowIndex].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["norms"].Value = CommonCtrl.IsNullToString(dpr["model"]);
dgvMaterials.Rows[e.RowIndex].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["unit"]);
dgvMaterials.Rows[e.RowIndex].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value = "1";
dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value = CommonCtrl.IsNullToString(dpr["ref_out_price"]);
string strPzk = !string.IsNullOrEmpty(labMemberLZkS.Text) ? labMemberLZkS.Text : "10";
//会员折扣
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value = Convert.ToString(Convert.ToDecimal(strPzk) * 10);
string strNum = dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value.ToString();
string strUMoney = dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value != null ? dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value.ToString() : "0";
//会员单价
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_price"].Value = Convert.ToString(Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney) * Convert.ToDecimal(dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value) / 10);
dgvMaterials.Rows[e.RowIndex].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[e.RowIndex].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dpr["remark"]);
dgvMaterials.Rows[e.RowIndex].Cells["vehicle_brand"].Value = CommonFuncCall.GetCarTypeForMa((CommonCtrl.IsNullToString(dpr["ser_parts_code"])));
}
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)))
{
dcPmoney += Convert.ToDecimal(dgvr.Cells["sum_money"].Value);
}
}
}
txtFSumMoney.Caption = dcPmoney.ToString();
}
}
catch (Exception ex)
{
HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex);
}
}
示例13: dgvMaterials_CellDoubleClick
private void dgvMaterials_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
dcPmoney = 0;
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[e.RowIndex].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["norms"].Value = CommonCtrl.IsNullToString(dpr["model"]);
dgvMaterials.Rows[e.RowIndex].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["default_unit_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value = "1";
dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value = CommonCtrl.IsNullToString(dpr["highest_out_price"]);
string strPzk = !string.IsNullOrEmpty(strMemberPZk) ? strMemberPZk : "10";
//会员折扣
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value = Convert.ToString(Convert.ToDecimal(strPzk) * 10);
string strNum = dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value.ToString();
string strUMoney = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value.ToString() : "0";
//会员单价
dgvMaterials.Rows[e.RowIndex].Cells["Mmember_price"].Value = Convert.ToString(Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney) * Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["Mmember_discount"].Value) : "0") / 10);
dgvMaterials.Rows[e.RowIndex].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[e.RowIndex].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dpr["remark"]);
dgvMaterials.Rows[e.RowIndex].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dpr["v_brand_name"]);
dgvMaterials.Rows[e.RowIndex].Cells["M_Id"].Value = frmPart.PartsID;
}
dcPmoney = 0;
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)))
{
dcPmoney += Convert.ToDecimal(dgvr.Cells["sum_money"].Value);
}
}
txtFSumMoney.Caption = dcPmoney.ToString();
txtFTaxCost.Caption = Convert.ToString(Convert.ToDecimal(!string.IsNullOrEmpty(txtFSumMoney.Caption.Trim()) ? txtFSumMoney.Caption.Trim() : "0") * Convert.ToDecimal(!string.IsNullOrEmpty(txtFTaxRate.Caption.Trim()) ? txtFTaxRate.Caption.Trim() : "0"));//配件税额
txtFSum.Caption = Convert.ToString(Convert.ToDecimal(!string.IsNullOrEmpty(txtFSumMoney.Caption.Trim()) ? txtFSumMoney.Caption.Trim() : "0") + Convert.ToDecimal(!string.IsNullOrEmpty(txtFTaxCost.Caption.Trim()) ? txtFTaxCost.Caption.Trim() : "0"));//配件价税合计
txtShouldSum.Caption = Convert.ToString(Convert.ToDecimal(!string.IsNullOrEmpty(txtHSum.Caption.Trim()) ? txtHSum.Caption.Trim() : "0") + Convert.ToDecimal(!string.IsNullOrEmpty(txtFSum.Caption.Trim()) ? txtFSum.Caption.Trim() : "0") + Convert.ToDecimal(!string.IsNullOrEmpty(txtOSum.Caption.Trim()) ? txtOSum.Caption.Trim() : "0") - Convert.ToDecimal(!string.IsNullOrEmpty(txtPrivilegeCost.Caption.Trim()) ? txtPrivilegeCost.Caption.Trim() : "0"));//应收总额
dgvMaterials.Rows.Add(1);
}
}
示例14: eidtParts_Click
private void eidtParts_Click(object sender, EventArgs e)
{
try
{
int intMrows = dgvMaterials.CurrentRow.Index;
if (intMrows >= 0)
{
string strPcode = CommonCtrl.IsNullToString(dgvMaterials.Rows[intMrows].Cells["parts_code"].Value);
if (!string.IsNullOrEmpty(strPcode))
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts_chooser", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
if (listMater.Contains(CommonCtrl.IsNullToString(dpr["ser_parts_code"])))
{
if (MessageBoxEx.Show("已添加此配件,是否继续添加?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
}
dgvMaterials.Rows[intMrows].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
dgvMaterials.Rows[intMrows].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dpr["parts_name"]);
dgvMaterials.Rows[intMrows].Cells["unit"].Value = CommonCtrl.IsNullToString(dpr["unit"]);
dgvMaterials.Rows[intMrows].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dpr["drawing_num"]);
dgvMaterials.Rows[intMrows].Cells["quantity"].Value = "0";
dgvMaterials.Rows[intMrows].Cells["unit_price"].Value = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dpr["ref_out_price"])) ? CommonCtrl.IsNullToString(dpr["ref_out_price"]) : "0";
dgvMaterials.Rows[intMrows].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dpr["is_import"]) == "1" ? "是" : "否";
dgvMaterials.Rows[intMrows].Cells["vehicle_brand"].Value = CommonFuncCall.GetCarTypeForMa((CommonCtrl.IsNullToString(dpr["ser_parts_code"])));
listMater.Remove(strPcode);
foreach (DataGridViewRow dgvr in dgvMaterials.Rows)
{
string strPCode = CommonCtrl.IsNullToString(dgvr.Cells["parts_code"].Value);
if (!string.IsNullOrEmpty(strPCode) && !listMater.Contains(strPCode))
{
listMater.Add(strPCode);
}
}
}
}
}
}
}
catch (Exception ex)
{
HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex);
}
}
示例15: txtPartCode_ChooserClick
private void txtPartCode_ChooserClick(object sender, EventArgs e)
{
frmParts frmPart = new frmParts();
DialogResult result = frmPart.ShowDialog();
if (result == DialogResult.OK)
{
string strPId = frmPart.PartsID;
DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strPId + "'", "", "");
if (dpt.Rows.Count > 0)
{
DataRow dpr = dpt.Rows[0];
txtPartCode.Text = CommonCtrl.IsNullToString(dpr["ser_parts_code"]);
txtPartType.Caption = GetDicName(CommonCtrl.IsNullToString(dpr["parts_type"]));
txtPartName.Caption = CommonCtrl.IsNullToString(dpr["parts_name"]);
}
}
}