//保存合同基本信息 protected void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtConNO.Text) && hidState.Value == "-1") { //更新 Mod_TMO_CON mod = con.GetModel(txtConNO.Text); mod.C_CON_NAME = txtConName.Text; mod.C_CON_TYPE = dropConType.SelectedItem.Text; mod.C_CUST_NAME = txtCustName.Text; mod.C_CUST_MAKING = ltlCustName.Text; mod.C_CUST_MAKING_DT = DateTime.Now; mod.C_CURRENCY_TYPE = dropCurrType.SelectedItem.Text; mod.D_CONSING_DT = Convert.ToDateTime(txtDate.Value); mod.D_CONEFFE_DT = Convert.ToDateTime(txtStart.Value); mod.D_CONINVALID_DT = Convert.ToDateTime(txtEnd.Value); if (!string.IsNullOrEmpty(ltlSysDate.Text)) { mod.D_SYS_CONINVALID_DT = Convert.ToDateTime(ltlSysDate.Text); } else { mod.D_SYS_CONINVALID_DT = Convert.ToDateTime(txtEnd.Value); } mod.C_SHIPVIA = dropShipVia.SelectedItem.Text; mod.C_CON_AREA = dropConArea.SelectedItem.Text; if (con.Update(mod)) { WebMsg.MessageBox("保存成功"); } } else { //新增一条 string conNo = service.CreateConNo(Convert.ToInt32(dropConArea.SelectedValue)); Mod_TMO_CON mod = new Mod_TMO_CON(); mod.C_CON_NO = conNo; mod.C_CON_NAME = txtConName.Text; mod.C_CON_TYPE = dropConType.SelectedItem.Text; mod.C_CUST_NO = ltlCUST_NO.Text; mod.C_CUST_NAME = txtCustName.Text; mod.C_CUST_MAKING = ltlCustName.Text; mod.C_CUST_MAKING_DT = DateTime.Now; mod.C_CURRENCY_TYPE = dropCurrType.SelectedItem.Text; mod.D_CONSING_DT = Convert.ToDateTime(txtDate.Value); mod.D_CONEFFE_DT = Convert.ToDateTime(txtStart.Value); mod.D_CONINVALID_DT = Convert.ToDateTime(txtEnd.Value); if (!string.IsNullOrEmpty(ltlSysDate.Text)) { mod.D_SYS_CONINVALID_DT = Convert.ToDateTime(ltlSysDate.Text); } else { mod.D_SYS_CONINVALID_DT = Convert.ToDateTime(txtEnd.Value); } mod.C_SHIPVIA = dropShipVia.SelectedItem.Text; mod.C_CON_AREA = dropConArea.SelectedItem.Text; var BaseUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"]; if (BaseUser != null) { mod.C_EMP_ID = BaseUser.Id; mod.C_EMP_NAME = BaseUser.Name; } if (con.Add(mod)) { WebMsg.MessageBox("保存成功,请添加订单"); txtConNO.Text = conNo; txtState.Text = GetOrderState(-1); } } }