private void SaveQuatation_Info() { var cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string uid = ticket.UserData; TSM.BLL.pms_Quotation_Info m_bllpms_Quotation_Info = new TSM.BLL.pms_Quotation_Info(); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = new TSM.Model.pms_Quotation_Info(); modelpms_Quotation_Info.ProductInfoID = m_bllpms_Product_Info.GetMaxId() - 1; modelpms_Quotation_Info.QuotationDepart = 1; modelpms_Quotation_Info.QuotationTime = DateTime.Now.Date; modelpms_Quotation_Info.KnifeCharges = 0; modelpms_Quotation_Info.ToolCharges = 0; modelpms_Quotation_Info.SprayingCharges = 0; modelpms_Quotation_Info.PackingCharges = 0; modelpms_Quotation_Info.TestingCharges = 0; modelpms_Quotation_Info.TransportCharges = 0; modelpms_Quotation_Info.QuotationPrice = 0; modelpms_Quotation_Info.ApprovalStatus = "待报价"; modelpms_Quotation_Info.UserInfoID = int.Parse(uid); modelpms_Quotation_Info.TransportDescrib = ""; modelpms_Quotation_Info.TestingDescrib = ""; modelpms_Quotation_Info.ChargeDescrib = ""; modelpms_Quotation_Info.SprayingDescrib = ""; modelpms_Quotation_Info.ToolsDescrib = ""; modelpms_Quotation_Info.KinfeDescrib = ""; modelpms_Quotation_Info.PackingDescrib = ""; m_bllpms_Quotation_Info.Add(modelpms_Quotation_Info); }
private void SaveProductType() { var cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string uid = ticket.UserData; TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = new TSM.Model.pms_Quotation_Info(); modelpms_Quotation_Info.QuotationInfoID = int.Parse(lbBatchID.Text); modelpms_Quotation_Info.ProductInfoID = int.Parse(lbProID.Text); modelpms_Quotation_Info.QuotationDepart = int.Parse(ddlCom.SelectedValue); modelpms_Quotation_Info.QuotationTime = DateTime.Now.Date; modelpms_Quotation_Info.KnifeCharges = Convert.ToDecimal(tbxKnife.Text); modelpms_Quotation_Info.ToolCharges = Convert.ToDecimal(tbxTool.Text); modelpms_Quotation_Info.SprayingCharges = Convert.ToDecimal(tbxSpray.Text); modelpms_Quotation_Info.PackingCharges = Convert.ToDecimal(tbxPack.Text); modelpms_Quotation_Info.TestingCharges = Convert.ToDecimal(tbxTest.Text); modelpms_Quotation_Info.TransportCharges = Convert.ToDecimal(tbxTrans.Text); modelpms_Quotation_Info.QuotationPrice = 0; modelpms_Quotation_Info.ApprovalStatus = "待生产部审批"; modelpms_Quotation_Info.UserInfoID = int.Parse(uid); modelpms_Quotation_Info.ToolsDescrib = tbxToolDesc.Text; modelpms_Quotation_Info.KinfeDescrib = tbxKnifeDesc.Text; modelpms_Quotation_Info.PackingDescrib = tbxPackDesc.Text; modelpms_Quotation_Info.TransportDescrib = tbxTransDesc.Text; modelpms_Quotation_Info.ChargeDescrib = tbxChargeDesc.Text; modelpms_Quotation_Info.TestingDescrib = tbxTestDesc.Text; modelpms_Quotation_Info.SprayingDescrib = tbxSprayDesc.Text; m_bllpms_Quotation_Info.Update(modelpms_Quotation_Info); }
private void SaveProductType() { var cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string uid = ticket.UserData; TSM.Model.pms_Approval_Info modelpms_Approval_Info = new TSM.Model.pms_Approval_Info(); modelpms_Approval_Info.QuotationInfoID = int.Parse(lbBatchID.Text); modelpms_Approval_Info.UserInfoID = int.Parse(uid); modelpms_Approval_Info.QuotationRate = int.Parse(tbxChar.Text); modelpms_Approval_Info.TransportRate = int.Parse(tbxTrans.Text); modelpms_Approval_Info.TestingRate = int.Parse(tbxTest.Text); modelpms_Approval_Info.PackingRate = int.Parse(tbxPack.Text); modelpms_Approval_Info.KnifeRate = int.Parse(tbxKnife.Text); modelpms_Approval_Info.ToolRate = int.Parse(tbxTool.Text); modelpms_Approval_Info.ApprovalDate = DateTime.Now.Date; modelpms_Approval_Info.Remarks = tbxRemark.Text; m_bllpms_Approval_Info.Add(modelpms_Approval_Info); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = new TSM.Model.pms_Quotation_Info(); modelpms_Quotation_Info.QuotationInfoID = int.Parse(lbBatchID.Text); if (uid == "4") { modelpms_Quotation_Info.ApprovalStatus = "待公司领导审批"; } else { modelpms_Quotation_Info.ApprovalStatus = "审批通过"; } m_bllpms_Quotation_Info.UpdateStatus(modelpms_Quotation_Info); }
protected void tbxChar_Click(object sender, EventArgs e) { int id = GetQueryIntValue("id"); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = m_bllpms_Quotation_Info.GetModel2(id); lbPrice1.Text = (Convert.ToDecimal(tbxChar.Text) + Convert.ToDecimal(tbxPack.Text) + Convert.ToDecimal(tbxTest.Text) + Convert.ToDecimal(tbxTrans.Text)).ToString(); tbxPrice.Text = Math.Round((Convert.ToDecimal(lbPrice1.Text) / Convert.ToDecimal(lbPrice0.Text) - 1) * 100, 0).ToString(); lbPriceOnce1.Text = (Convert.ToDecimal(tbxKnife.Text) + Convert.ToDecimal(tbxTool.Text)).ToString(); lbUPrice0.Text = Math.Round(Convert.ToDecimal(lbPrice1.Text) / modelpms_Quotation_Info.净重, 0).ToString(); }
private void LoadData1() { string weight = GetQueryValue("id1"); int id1 = GetQueryIntValue("id"); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = m_bllpms_Quotation_Info.GetModel(id1); tbxCharge.Text = modelpms_Quotation_Info.Charge.ToString().Trim(); decimal Price = Convert.ToDecimal(modelpms_Quotation_Info.Charge) + Convert.ToDecimal(tbxPack.Text) + Convert.ToDecimal(tbxTrans.Text) + Convert.ToDecimal(tbxTest.Text) + Convert.ToDecimal(tbxSpray.Text); lbUnitPrice.Text = Math.Round((Price / Convert.ToDecimal(weight)), 0).ToString(); }
/// <summary> /// 更新审批标志记录 /// </summary> public void UpdateStatus(TSM.Model.pms_Quotation_Info model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update pms_Quotation_Info set "); strSql.Append("ApprovalStatus=@ApprovalStatus"); strSql.Append(" where QuotationInfoID=@QuotationInfoID "); SqlParameter[] parameters = { new SqlParameter("@QuotationInfoID", SqlDbType.Int, 4), new SqlParameter("@ApprovalStatus", SqlDbType.VarChar, 64) }; parameters[0].Value = model.QuotationInfoID; parameters[1].Value = model.ApprovalStatus; DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); }
private void LoadData() { var cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string uid = ticket.UserData; //// 默认的排序列和排序方向 //Grid1.SortColumnIndex = 0; //Grid1.SortDirection = "DESC"; // 每页记录数 Grid1.PageSize = 15; //// 点击删除按钮时,至少选中一项 //ResolveDeleteGridItem(btnDeleteSelected, Grid1); int id = GetQueryIntValue("id"); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = m_bllpms_Quotation_Info.GetModel(id); modelpms_Quotation_Info = m_bllpms_Quotation_Info.GetModel2(id); if (modelpms_Quotation_Info == null) { // 参数错误,首先弹出Alert对话框然后关闭弹出窗口 Alert.Show("参数错误!", String.Empty, ActiveWindow.GetHideReference()); return; } //给控件赋初值,显示 lbBatchID.Text = modelpms_Quotation_Info.QuotationInfoID.ToString().Trim(); lbChar0.Text = modelpms_Quotation_Info.加工费用.ToString().Trim(); if (uid == "4") { lbPack0.Text = Convert.ToInt64(Convert.ToDecimal(modelpms_Quotation_Info.包装费用) + Convert.ToDecimal(modelpms_Quotation_Info.喷涂费用)).ToString(); tbxPack.Text = Convert.ToInt64(Convert.ToDecimal(modelpms_Quotation_Info.包装费用) + Convert.ToDecimal(modelpms_Quotation_Info.喷涂费用)).ToString(); } else { lbPack0.Text = Convert.ToInt64(Convert.ToDecimal(modelpms_Quotation_Info.包装费用)).ToString(); tbxPack.Text = Convert.ToInt64(Convert.ToDecimal(modelpms_Quotation_Info.包装费用)).ToString(); } lbTest0.Text = modelpms_Quotation_Info.检测费用.ToString().Trim(); lbTrans0.Text = modelpms_Quotation_Info.运输费用.ToString().Trim(); lbKnife0.Text = modelpms_Quotation_Info.刀具费用.ToString().Trim(); lbTool0.Text = modelpms_Quotation_Info.工装费用.ToString().Trim(); lbPrice0.Text = (Convert.ToDecimal(lbChar0.Text) + Convert.ToDecimal(lbPack0.Text) + Convert.ToDecimal(lbTest0.Text) + Convert.ToDecimal(lbTrans0.Text)).ToString(); lbChar2.Text = modelpms_Quotation_Info.加工信息.ToString().Trim(); lbPack2.Text = modelpms_Quotation_Info.包装信息 + ";喷涂:" + modelpms_Quotation_Info.喷涂信息; lbTest2.Text = modelpms_Quotation_Info.检测信息.ToString().Trim(); lbTrans2.Text = modelpms_Quotation_Info.运费信息.ToString().Trim(); lbKnife2.Text = modelpms_Quotation_Info.刀具信息.ToString().Trim(); lbTool2.Text = modelpms_Quotation_Info.工装信息.ToString().Trim(); tbxChar.Text = modelpms_Quotation_Info.加工费用.ToString().Trim(); tbxTest.Text = modelpms_Quotation_Info.检测费用.ToString().Trim(); tbxTrans.Text = modelpms_Quotation_Info.运输费用.ToString().Trim(); tbxKnife.Text = modelpms_Quotation_Info.刀具费用.ToString().Trim(); tbxTool.Text = modelpms_Quotation_Info.工装费用.ToString().Trim(); lbPrice1.Text = (Convert.ToDecimal(tbxChar.Text) + Convert.ToDecimal(tbxPack.Text) + Convert.ToDecimal(tbxTest.Text) + Convert.ToDecimal(tbxTrans.Text)).ToString(); tbxPrice.Text = Math.Round((Convert.ToDecimal(lbPrice1.Text) / Convert.ToDecimal(lbPrice0.Text) - 1) * 100, 0).ToString(); lbPriceOnce0.Text = (Convert.ToDecimal(lbTool0.Text) + Convert.ToDecimal(lbKnife0.Text)).ToString(); lbPriceOnce1.Text = (Convert.ToDecimal(tbxKnife.Text) + Convert.ToDecimal(tbxTool.Text)).ToString(); lbUPrice0.Text = Math.Round(Convert.ToDecimal(lbPrice1.Text) / modelpms_Quotation_Info.净重, 0).ToString(); //绑定表格 BindGrid(); //父窗口向子窗口传值 string BatchId = lbBatchID.Text.ToString().Trim(); // btnNew.OnClientClick = Window1.GetSaveStateReference(tbxCharge.ClientID) + Window1.GetShowReference("~/pms_Quotation_Info_new.aspx?id=" + BatchId, "添加机床"); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TSM.Model.pms_Quotation_Info model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into pms_Quotation_Info("); strSql.Append("ProductInfoID,QuotationDepart,UserInfoID,KnifeCharges,ToolCharges,QuotationPrice,ApprovalStatus,QuotationTime,SprayingCharges,PackingCharges,TestingCharges,TransportCharges,"); strSql.Append("SprayingDescrib,PackingDescrib,TestingDescrib,TransportDescrib,ChargeDescrib,KinfeDescrib,ToolsDescrib)"); strSql.Append(" values ("); strSql.Append("@ProductInfoID,@QuotationDepart,@UserInfoID,@KnifeCharges,@ToolCharges,@QuotationPrice,@ApprovalStatus,@QuotationTime,@SprayingCharges,@PackingCharges,@TestingCharges,@TransportCharges,"); strSql.Append("@SprayingDescrib,@PackingDescrib,@TestingDescrib,@TransportDescrib,@ChargeDescrib,@KinfeDescrib,@ToolsDescrib)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ProductInfoID", SqlDbType.Int, 4), new SqlParameter("@QuotationDepart", SqlDbType.Int, 4), new SqlParameter("@UserInfoID", SqlDbType.Int, 4), new SqlParameter("@KnifeCharges", SqlDbType.Decimal, 9), new SqlParameter("@ToolCharges", SqlDbType.Decimal, 9), new SqlParameter("@QuotationPrice", SqlDbType.Decimal, 9), new SqlParameter("@ApprovalStatus", SqlDbType.VarChar, 64), new SqlParameter("@QuotationTime", SqlDbType.DateTime), new SqlParameter("@SprayingCharges", SqlDbType.Decimal, 9), new SqlParameter("@PackingCharges", SqlDbType.Decimal, 9), new SqlParameter("@TestingCharges", SqlDbType.Decimal, 9), new SqlParameter("@TransportCharges", SqlDbType.Decimal, 9), new SqlParameter("@SprayingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@PackingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@TestingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@TransportDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@ChargeDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@KinfeDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@ToolsDescrib", SqlDbType.NVarChar, 64) }; parameters[0].Value = model.ProductInfoID; parameters[1].Value = model.QuotationDepart; parameters[2].Value = model.UserInfoID; parameters[3].Value = model.KnifeCharges; parameters[4].Value = model.ToolCharges; parameters[5].Value = model.QuotationPrice; parameters[6].Value = model.ApprovalStatus; parameters[7].Value = model.QuotationTime; parameters[8].Value = model.SprayingCharges; parameters[9].Value = model.PackingCharges; parameters[10].Value = model.TestingCharges; parameters[11].Value = model.TransportCharges; parameters[12].Value = model.SprayingDescrib; parameters[13].Value = model.PackingDescrib; parameters[14].Value = model.TestingDescrib; parameters[15].Value = model.TransportDescrib; parameters[16].Value = model.ChargeDescrib; parameters[17].Value = model.KinfeDescrib; parameters[18].Value = model.ToolsDescrib; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 得到一个对象实体 /// </summary> public TSM.Model.pms_Quotation_Info GetModel3(int QuotationInfoID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select * from view_pms_Quotation_Info3 "); strSql.Append(" where QuotationInfoID=@QuotationInfoID "); SqlParameter[] parameters = { new SqlParameter("@QuotationInfoID", SqlDbType.Int, 4) }; parameters[0].Value = QuotationInfoID; TSM.Model.pms_Quotation_Info model = new TSM.Model.pms_Quotation_Info(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["QuotationInfoID"].ToString() != "") { model.QuotationInfoID = int.Parse(ds.Tables[0].Rows[0]["QuotationInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["ProductInfoID"].ToString() != "") { model.ProductInfoID = int.Parse(ds.Tables[0].Rows[0]["ProductInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["QuotationDepart"].ToString() != "") { model.QuotationDepart = int.Parse(ds.Tables[0].Rows[0]["QuotationDepart"].ToString()); } if (ds.Tables[0].Rows[0]["UserInfoID"].ToString() != "") { model.UserInfoID = int.Parse(ds.Tables[0].Rows[0]["UserInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["KnifeCharges"].ToString() != "") { model.KnifeCharges = decimal.Parse(ds.Tables[0].Rows[0]["KnifeCharges"].ToString()); } if (ds.Tables[0].Rows[0]["ToolCharges"].ToString() != "") { model.ToolCharges = decimal.Parse(ds.Tables[0].Rows[0]["ToolCharges"].ToString()); } model.ApprovalStatus = ds.Tables[0].Rows[0]["ApprovalStatus"].ToString(); if (ds.Tables[0].Rows[0]["QuotationTime"].ToString() != "") { model.QuotationTime = DateTime.Parse(ds.Tables[0].Rows[0]["QuotationTime"].ToString()); } if (ds.Tables[0].Rows[0]["PackingCharges"].ToString() != "") { model.PackingCharges = decimal.Parse(ds.Tables[0].Rows[0]["PackingCharges"].ToString()); } if (ds.Tables[0].Rows[0]["TestingCharges"].ToString() != "") { model.TestingCharges = decimal.Parse(ds.Tables[0].Rows[0]["TestingCharges"].ToString()); } if (ds.Tables[0].Rows[0]["TransportCharges"].ToString() != "") { model.TransportCharges = decimal.Parse(ds.Tables[0].Rows[0]["TransportCharges"].ToString()); } if (ds.Tables[0].Rows[0]["Charge"].ToString() != "") { model.Charge = decimal.Parse(ds.Tables[0].Rows[0]["Charge"].ToString()); } if (ds.Tables[0].Rows[0]["Remarks"].ToString() != "") { model.Remarks = ds.Tables[0].Rows[0]["Remarks"].ToString(); } return(model); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public TSM.Model.pms_Quotation_Info GetModel2(int QuotationInfoID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select * from view_pms_Product_Info_Final "); strSql.Append(" where QuotationInfoID=@QuotationInfoID "); SqlParameter[] parameters = { new SqlParameter("@QuotationInfoID", SqlDbType.Int, 4) }; parameters[0].Value = QuotationInfoID; TSM.Model.pms_Quotation_Info model = new TSM.Model.pms_Quotation_Info(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["QuotationInfoID"].ToString() != "") { model.QuotationInfoID = int.Parse(ds.Tables[0].Rows[0]["QuotationInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["ProductInfoID"].ToString() != "") { model.ProductInfoID = int.Parse(ds.Tables[0].Rows[0]["ProductInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["刀具费用"].ToString() != "") { model.刀具费用 = decimal.Parse(ds.Tables[0].Rows[0]["刀具费用"].ToString()); } if (ds.Tables[0].Rows[0]["工装费用"].ToString() != "") { model.工装费用 = decimal.Parse(ds.Tables[0].Rows[0]["工装费用"].ToString()); } model.审批状态 = ds.Tables[0].Rows[0]["审批状态"].ToString(); if (ds.Tables[0].Rows[0]["包装费用"].ToString() != "") { model.包装费用 = decimal.Parse(ds.Tables[0].Rows[0]["包装费用"].ToString()); } if (ds.Tables[0].Rows[0]["检测费用"].ToString() != "") { model.检测费用 = decimal.Parse(ds.Tables[0].Rows[0]["检测费用"].ToString()); } if (ds.Tables[0].Rows[0]["运输费用"].ToString() != "") { model.运输费用 = decimal.Parse(ds.Tables[0].Rows[0]["运输费用"].ToString()); } if (ds.Tables[0].Rows[0]["加工费用"].ToString() != "") { model.加工费用 = decimal.Parse(ds.Tables[0].Rows[0]["加工费用"].ToString()); } if (ds.Tables[0].Rows[0]["喷涂费用"].ToString() != "") { model.喷涂费用 = decimal.Parse(ds.Tables[0].Rows[0]["喷涂费用"].ToString()); } model.运费信息 = ds.Tables[0].Rows[0]["运费信息"].ToString(); model.包装信息 = ds.Tables[0].Rows[0]["包装信息"].ToString(); model.喷涂信息 = ds.Tables[0].Rows[0]["喷涂信息"].ToString(); model.检测信息 = ds.Tables[0].Rows[0]["检测信息"].ToString(); model.加工信息 = ds.Tables[0].Rows[0]["加工信息"].ToString(); model.刀具信息 = ds.Tables[0].Rows[0]["刀具信息"].ToString(); model.工装信息 = ds.Tables[0].Rows[0]["工装信息"].ToString(); model.净重 = Convert.ToDecimal(ds.Tables[0].Rows[0]["净重"]); return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public void Update(TSM.Model.pms_Quotation_Info model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update pms_Quotation_Info set "); strSql.Append("ProductInfoID=@ProductInfoID,"); strSql.Append("QuotationDepart=@QuotationDepart,"); strSql.Append("KnifeCharges=@KnifeCharges,"); strSql.Append("ToolCharges=@ToolCharges,"); strSql.Append("QuotationPrice=@QuotationPrice,"); strSql.Append("ApprovalStatus=@ApprovalStatus,"); strSql.Append("QuotationTime=@QuotationTime,"); strSql.Append("SprayingCharges=@SprayingCharges,"); strSql.Append("PackingCharges=@PackingCharges,"); strSql.Append("TestingCharges=@TestingCharges,"); strSql.Append("TransportCharges=@TransportCharges,"); strSql.Append("SprayingDescrib=@SprayingDescrib,"); strSql.Append("PackingDescrib=@PackingDescrib,"); strSql.Append("TestingDescrib=@TestingDescrib,"); strSql.Append("TransportDescrib=@TransportDescrib,"); strSql.Append("ChargeDescrib=@ChargeDescrib,"); strSql.Append("KinfeDescrib=@KinfeDescrib,"); strSql.Append("ToolsDescrib=@ToolsDescrib,"); strSql.Append("UserInfoID=@UserInfoID"); strSql.Append(" where QuotationInfoID=@QuotationInfoID "); SqlParameter[] parameters = { new SqlParameter("@QuotationInfoID", SqlDbType.Int, 4), new SqlParameter("@ProductInfoID", SqlDbType.Int, 4), new SqlParameter("@QuotationDepart", SqlDbType.Int, 4), new SqlParameter("@KnifeCharges", SqlDbType.Decimal, 9), new SqlParameter("@ToolCharges", SqlDbType.Decimal, 9), new SqlParameter("@QuotationPrice", SqlDbType.Decimal, 9), new SqlParameter("@ApprovalStatus", SqlDbType.VarChar, 64), new SqlParameter("@QuotationTime", SqlDbType.DateTime), new SqlParameter("@SprayingCharges", SqlDbType.Decimal, 9), new SqlParameter("@PackingCharges", SqlDbType.Decimal, 9), new SqlParameter("@TestingCharges", SqlDbType.Decimal, 9), new SqlParameter("@TransportCharges", SqlDbType.Decimal, 9), new SqlParameter("@UserInfoID", SqlDbType.Int, 4), new SqlParameter("@SprayingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@PackingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@TestingDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@TransportDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@ChargeDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@KinfeDescrib", SqlDbType.NVarChar, 64), new SqlParameter("@ToolsDescrib", SqlDbType.NVarChar, 64) }; parameters[0].Value = model.QuotationInfoID; parameters[1].Value = model.ProductInfoID; parameters[2].Value = model.QuotationDepart; parameters[3].Value = model.KnifeCharges; parameters[4].Value = model.ToolCharges; parameters[5].Value = model.QuotationPrice; parameters[6].Value = model.ApprovalStatus; parameters[7].Value = model.QuotationTime; parameters[8].Value = model.SprayingCharges; parameters[9].Value = model.PackingCharges; parameters[10].Value = model.TestingCharges; parameters[11].Value = model.TransportCharges; parameters[12].Value = model.UserInfoID; parameters[13].Value = model.SprayingDescrib; parameters[14].Value = model.PackingDescrib; parameters[15].Value = model.TestingDescrib; parameters[16].Value = model.TransportDescrib; parameters[17].Value = model.ChargeDescrib; parameters[18].Value = model.KinfeDescrib; parameters[19].Value = model.ToolsDescrib; DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); }
private void LoadData() { //绑定报价单位下拉列表控件 DataSet dsCom = m_bllpms_Company_Info.GetList(""); ddlCom.DataValueField = "CompanyInfoID"; ddlCom.DataTextField = "CompanyName"; ddlCom.DataSource = dsCom.Tables[0]; ddlCom.DataBind(); //// 默认的排序列和排序方向 //Grid1.SortColumnIndex = 0; //Grid1.SortDirection = "DESC"; // 每页记录数 Grid1.PageSize = 15; //// 点击删除按钮时,至少选中一项 //ResolveDeleteGridItem(btnDeleteSelected, Grid1); int id = GetQueryIntValue("id"); string weight = GetQueryValue("id1"); TSM.Model.pms_Quotation_Info modelpms_Quotation_Info = m_bllpms_Quotation_Info.GetModel(id); if (modelpms_Quotation_Info == null) { // 参数错误,首先弹出Alert对话框然后关闭弹出窗口 Alert.Show("参数错误!", String.Empty, ActiveWindow.GetHideReference()); return; } else { //给控件赋初值,显示 lbBatchID.Text = modelpms_Quotation_Info.QuotationInfoID.ToString().Trim(); ddlCom.SelectedValue = modelpms_Quotation_Info.QuotationDepart.ToString().Trim(); tbxKnife.Text = modelpms_Quotation_Info.KnifeCharges.ToString().Trim(); tbxTool.Text = modelpms_Quotation_Info.ToolCharges.ToString().Trim(); tbxSpray.Text = modelpms_Quotation_Info.SprayingCharges.ToString().Trim(); tbxPack.Text = modelpms_Quotation_Info.PackingCharges.ToString().Trim(); tbxTest.Text = modelpms_Quotation_Info.TestingCharges.ToString().Trim(); tbxTrans.Text = modelpms_Quotation_Info.TransportCharges.ToString().Trim(); tbxCharge.Text = modelpms_Quotation_Info.Charge.ToString().Trim(); lbProID.Text = modelpms_Quotation_Info.ProductInfoID.ToString().Trim(); if (modelpms_Quotation_Info.ChargeDescrib != null) { tbxChargeDesc.Text = modelpms_Quotation_Info.ChargeDescrib; } if (modelpms_Quotation_Info.KinfeDescrib != null) { tbxKnifeDesc.Text = modelpms_Quotation_Info.KinfeDescrib; } if (modelpms_Quotation_Info.PackingDescrib != null) { tbxPackDesc.Text = modelpms_Quotation_Info.PackingDescrib; } if (modelpms_Quotation_Info.SprayingDescrib != null) { tbxSprayDesc.Text = modelpms_Quotation_Info.SprayingDescrib; } if (modelpms_Quotation_Info.TestingDescrib != null) { tbxTestDesc.Text = modelpms_Quotation_Info.TestingDescrib; } if (modelpms_Quotation_Info.ToolsDescrib != null) { tbxToolDesc.Text = modelpms_Quotation_Info.ToolsDescrib; } if (modelpms_Quotation_Info.TransportDescrib != null) { tbxTransDesc.Text = modelpms_Quotation_Info.TransportDescrib; } if (modelpms_Quotation_Info.Charge.ToString().Trim() != null) { decimal Price = Convert.ToDecimal(modelpms_Quotation_Info.Charge) + Convert.ToDecimal(tbxPack.Text) + Convert.ToDecimal(tbxTrans.Text) + Convert.ToDecimal(tbxTest.Text) + Convert.ToDecimal(tbxSpray.Text); lbUnitPrice.Text = Math.Round((Price / Convert.ToDecimal(weight)), 0).ToString(); } } //绑定表格 BindGrid(); //父窗口向子窗口传值 string BatchId = lbBatchID.Text.ToString().Trim(); btnNew.OnClientClick = Window1.GetSaveStateReference(tbxCharge.ClientID) + Window1.GetShowReference("~/pms_Quotation_Info_new.aspx?id=" + BatchId, "添加机床"); }