public AjaxResult SetEval([FromBody] dynamic Json) { #region //接收参数 string ResulID = Json.ResulID; //问题列表ID string Score = Json.Score; //分数 #endregion #region //数据操作 AjaxResult result = new AjaxResult(); result.Code = DoResult.Success; Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ResulID); mod.N_CUST_EVAL = Score == "" ? 0 : Convert.ToDecimal(Score); mod.N_STATE = 2; mod.D_CUST_EVAL_DT = DateTime.Now; if (tmc_tech_consult.Update(mod)) { result.Result = "评分成功"; } else { result.Result = "评分失败"; } #endregion return(result); }
//添加 protected void btnSave_Click(object sender, EventArgs e) { Mod_TMC_TECH_CONSULT mod = new Mod_TMC_TECH_CONSULT(); string C_ID = Guid.NewGuid().ToString(); mod.C_ID = C_ID; mod.C_QUEST_ID = dropQuest.SelectedValue; mod.C_CUST_NAME = txtCust.Value; mod.C_CUST_CODE = ltlCustNo.Text; mod.C_STL_GRD = txt_STL_GRD.Value; mod.C_USE_DESC = txtUseDesc.Value; mod.C_REMARK = txtRemark.Value; mod.C_EMP_ID = ltlUserID.Text; mod.C_EMP_NAME = ltlUserName.Text; if (tmc_tech_consult.Add(mod)) { DataTable dt = tmc_question_dept.GetQuestion_Dept(dropQuest.SelectedValue, "").Tables[0]; if (dt.Rows.Count > 0) { Mod_TMC_TECH_CONSULT_RESULT mod2 = new Mod_TMC_TECH_CONSULT_RESULT(); for (int i = 0; i < dt.Rows.Count; i++) { mod2.C_TECH_CONSULT_ID = C_ID; mod2.C_DEPT = dt.Rows[i]["C_DEPT_ID"].ToString(); tmc_tech_consult_result.Add(mod2); } } Response.Write("<script>alert('提交成功');window.close();window.opener.location.reload('MyConsult.aspx');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //获取用户所属公司名称 var BaseUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"]; if (BaseUser != null) { ltlEmpID.Text = BaseUser.Id; txtEmp.Value = BaseUser.Name; if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && !string.IsNullOrEmpty(Request.QueryString["dept"])) { ltlID.Text = Request.QueryString["ID"]; ltlDeptID.Text = Request.QueryString["dept"]; Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { Mod_TMC_QUESTION modQuestion = tmc_question.GetModel(mod.C_QUEST_ID); ltlQuest.Text = modQuestion.C_NAME; ltlSTL_GRD.Text = mod.C_STL_GRD; ltlCust.Text = mod.C_CUST_NAME; ltlUseDesc.Text = mod.C_USE_DESC; ltlQuestContent.Text = mod.C_REMARK; GetSubList(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //获取用户所属公司名称 var BaseUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"]; if (BaseUser != null) { try { ltlUserID.Text = BaseUser.Id; ltlUserName.Text = BaseUser.Name; //获取客户信息 if (!string.IsNullOrEmpty(BaseUser.CustId)) { Mod_TS_CUSTFILE mod = ts_custfile.GetModel(BaseUser.CustId); ltlCustNo.Text = mod.C_NO; txtcust.Text = mod.C_NAME; } GetQuestion(); if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { ltlID.Text = Request.QueryString["ID"]; Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { dropQuest.SelectedIndex = dropQuest.Items.IndexOf(dropQuest.Items.FindByText(mod.C_QUEST_ID)); txtgrd.Text = mod.C_STL_GRD; txtUseDesc.Value = mod.C_USE_DESC; txtRemark.Value = mod.C_REMARK; horderNO.Value = mod.C_ORDER_NO; } } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } } else { WebMsg.CheckUserLogin(); } } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(ltlID.Text)) { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); mod.C_QUEST_ID = dropQuest.SelectedValue; mod.C_CUST_NAME = txtcust.Text; mod.C_CUST_CODE = ltlCustNo.Text; mod.C_STL_GRD = txtgrd.Text; mod.C_USE_DESC = txtUseDesc.Value; mod.C_REMARK = txtRemark.Value; mod.C_EMP_ID = ltlUserID.Text; mod.C_EMP_NAME = ltlUserName.Text; mod.C_ORDER_NO = horderNO.Value; if (tmc_tech_consult.Update(mod)) { WebMsg.MessageBox("修改成功", "MyConsult.aspx"); //Response.Write("<script>alert('修改成功');window.close();window.opener.location.reload('MyConsult.aspx');</script>"); } } else { Mod_TMC_TECH_CONSULT mod = new Mod_TMC_TECH_CONSULT(); mod.C_QUEST_ID = dropQuest.SelectedValue; mod.C_CUST_NAME = txtcust.Text; mod.C_CUST_CODE = ltlCustNo.Text; mod.C_STL_GRD = txtgrd.Text; mod.C_USE_DESC = txtUseDesc.Value; mod.C_REMARK = txtRemark.Value; mod.C_EMP_ID = ltlUserID.Text; mod.C_EMP_NAME = ltlUserName.Text; mod.C_ORDER_NO = horderNO.Value; if (tmc_tech_consult.Add(mod)) { WebMsg.MessageBox("提交成功", "MyConsult.aspx"); //Response.Write("<script>alert('提交成功');window.close();window.opener.location.reload('MyConsult.aspx');</script>"); } } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } }
//评分 protected void btnSave_Click(object sender, EventArgs e) { try { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); mod.N_CUST_EVAL = Convert.ToDecimal(dropNum.SelectedItem.Value); mod.N_STATE = 2; mod.D_CUST_EVAL_DT = DateTime.Now; if (tmc_tech_consult.Update(mod)) { WebMsg.MessageBox("评分成功", "MyConsult.aspx"); } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } }
public AjaxResult ConsultEdit([FromBody] dynamic Json) { #region //接收参数 string ID = Json.ID; //主键 string QuestID = Json.QuestID; //技术问题ID string Stl_Grd = Json.Stl_Grd; //钢种 string UseDesc = Json.UseDesc; //用途及工艺 string Remark = Json.Remark; //问题描述 #endregion #region //数据操作 AjaxResult result = new AjaxResult(); result.Code = DoResult.Success; Mod_TS_USER modUser = GetUserID(); Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ID); if (mod.N_STATE == 0) { mod.C_QUEST_ID = QuestID; mod.C_STL_GRD = Stl_Grd; mod.C_USE_DESC = UseDesc; mod.C_REMARK = Remark; mod.C_EMP_ID = modUser.C_ID; mod.C_EMP_NAME = modUser.C_NAME; if (tmc_tech_consult.Update(mod)) { result.Result = "保存成功"; } else { result.Result = "保存失败"; } } else { result.Result = "当前状态咱不可修改"; } #endregion return(result); }
/// <summary> /// 获取技术咨询数据 /// </summary> private void GetList() { if (!string.IsNullOrEmpty(ltlID.Text)) { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { Mod_TMC_QUESTION modQuestion = tmc_question.GetModel(mod.C_QUEST_ID); ltlQuest.Text = modQuestion.C_NAME; ltlSTL_GRD.Text = mod.C_STL_GRD; ltlCust.Text = mod.C_CUST_NAME; ltlUseDesc.Text = mod.C_USE_DESC; ltlQuestContent.Text = mod.C_REMARK; GetQuestList(); } } }
//评分 protected void EB_Click(object sender, EventArgs e) { try { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { mod.N_XG_EVAL = Convert.ToDecimal(dropNum.SelectedItem.Text); mod.N_STATE = 3; mod.C_XG_EVAL_EMP = ltlUserName.Text; mod.D_XG_EVAL_DT = DateTime.Now; if (tmc_tech_consult.Update(mod)) { WebMsg.MessageBox("评分成功", "Consult_List.aspx"); } } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } }
/// <summary> /// 获取技术咨询数据 /// </summary> private void GetList() { if (!string.IsNullOrEmpty(ltlID.Text)) { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { btnSave.Visible = mod.N_STATE == 1 ? true : false; ltlDt.Text = Convert.ToDateTime(mod.D_MOD_DT).ToString("yyy-MM-dd"); ltlC_EMP_NAME.Text = mod.C_EMP_NAME; Mod_TMC_QUESTION modQuestion = tmc_question.GetModel(mod.C_QUEST_ID); ltlQuest.Text = modQuestion.C_NAME; ltlC_STL_GRD.Text = mod.C_STL_GRD; ltlUseDesc.Text = mod.C_USE_DESC; ltlQuestContent.Text = mod.C_REMARK; if (!string.IsNullOrEmpty(mod.D_PLAN_DT.ToString())) { ltlD_PLAN_DT.Text = Convert.ToDateTime(mod.D_PLAN_DT).ToString("yyy-MM-dd"); } if (!string.IsNullOrEmpty(mod.D_PLAN_DT.ToString())) { ltlD_FINISH_DT.Text = Convert.ToDateTime(mod.D_FINISH_DT).ToString("yyy-MM-dd"); } ltlC_EMP.Text = mod.C_EMP; ltlC_REAL_TIME.Text = mod.C_REAL_TIME; ltlC_RESULT.Text = mod.C_RESULT; ltlC_LEAVE_Q.Text = mod.C_LEAVE_Q; ltlC_REMARK2.Text = mod.C_REMARK2; dropNum.SelectedIndex = dropNum.Items.IndexOf(dropNum.Items.FindByValue(mod.N_CUST_EVAL.ToString())); ltlN_XG_EVAL.Text = mod.N_XG_EVAL.ToString(); } } }
public AjaxResult ConsultAdd([FromBody] dynamic Json) { #region //接收参数 string QuestID = Json.QuestID; //技术问题ID string Stl_Grd = Json.Stl_Grd; //钢种 string UseDesc = Json.UseDesc; //用途及工艺 string Remark = Json.Remark; //问题描述 #endregion #region //数据操作 AjaxResult result = new AjaxResult(); result.Code = DoResult.Success; Mod_TS_USER modUser = GetUserID(); Mod_TS_CUSTFILE modcustfile = ts_custfile.GetModel(modUser.C_CUST_ID); Mod_TMC_TECH_CONSULT mod = new Mod_TMC_TECH_CONSULT(); mod.C_QUEST_ID = QuestID; mod.C_CUST_NAME = modcustfile.C_NAME; mod.C_CUST_CODE = modcustfile.C_NO; mod.C_STL_GRD = Stl_Grd; mod.C_USE_DESC = UseDesc; mod.C_REMARK = Remark; mod.C_EMP_ID = modUser.C_ID; mod.C_EMP_NAME = modUser.C_NAME; if (tmc_tech_consult.Add(mod)) { result.Result = "提交成功"; } else { result.Result = "提交失败"; } #endregion return(result); }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TMC_TECH_CONSULT GetModel(string C_ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select C_ID,C_QUEST_ID,C_CUST_NAME,C_CUST_CODE,C_STL_GRD,C_USE_DESC,C_REMARK,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_DEPT,C_EMP,D_PLAN_DT,D_FINISH_DT,C_REAL_TIME,C_RESULT,C_LEAVE_Q,C_REMARK2,N_CUST_EVAL,N_STATE,D_CUST_EVAL_DT,N_XG_EVAL,C_XG_EVAL_EMP,D_XG_EVAL_DT,C_ORDER_NO from TMC_TECH_CONSULT "); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = C_ID; Mod_TMC_TECH_CONSULT model = new Mod_TMC_TECH_CONSULT(); DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TMC_TRAIN_MAIN GetModel(string C_ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT * FROM TMC_TRAIN_MAIN "); strSql.Append(" WHERE C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = C_ID; Mod_TMC_TECH_CONSULT model = new Mod_TMC_TECH_CONSULT(); DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
//保存 protected void EA_Click(object sender, EventArgs e) { try { Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { mod.D_PLAN_DT = Convert.ToDateTime(Start.Value); mod.D_FINISH_DT = Convert.ToDateTime(End.Value); if (!string.IsNullOrEmpty(mod.C_EMP)) { if (!mod.C_EMP.Contains(ltlUserName.Text)) { mod.C_EMP = mod.C_EMP + "," + ltlUserName.Text; } } else { mod.C_EMP = ltlUserName.Text; } mod.C_REAL_TIME = txtTIMECONTENT.Value; mod.C_RESULT = txtRESULTCONTENT.Value; mod.C_LEAVE_Q = txtQUESTCONTENT.Value; mod.C_REMARK2 = txtRemark.Value; mod.N_STATE = 1; if (tmc_tech_consult.Update(mod)) { WebMsg.MessageBox("保存成功", "Consult_List.aspx"); } } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TMC_TECH_CONSULT model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TMC_TECH_CONSULT model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TMC_TECH_CONSULT model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TMC_TECH_CONSULT set "); strSql.Append("C_QUEST_ID=:C_QUEST_ID,"); strSql.Append("C_CUST_NAME=:C_CUST_NAME,"); strSql.Append("C_CUST_CODE=:C_CUST_CODE,"); strSql.Append("C_STL_GRD=:C_STL_GRD,"); strSql.Append("C_USE_DESC=:C_USE_DESC,"); strSql.Append("C_REMARK=:C_REMARK,"); strSql.Append("C_EMP_ID=:C_EMP_ID,"); strSql.Append("C_EMP_NAME=:C_EMP_NAME,"); strSql.Append("D_MOD_DT=:D_MOD_DT,"); strSql.Append("C_DEPT=:C_DEPT,"); strSql.Append("C_EMP=:C_EMP,"); strSql.Append("D_PLAN_DT=:D_PLAN_DT,"); strSql.Append("D_FINISH_DT=:D_FINISH_DT,"); strSql.Append("C_REAL_TIME=:C_REAL_TIME,"); strSql.Append("C_RESULT=:C_RESULT,"); strSql.Append("C_LEAVE_Q=:C_LEAVE_Q,"); strSql.Append("C_REMARK2=:C_REMARK2,"); strSql.Append("N_CUST_EVAL=:N_CUST_EVAL,"); strSql.Append("N_STATE=:N_STATE,"); strSql.Append("D_CUST_EVAL_DT=:D_CUST_EVAL_DT,"); strSql.Append("N_XG_EVAL=:N_XG_EVAL,"); strSql.Append("C_XG_EVAL_EMP=:C_XG_EVAL_EMP,"); strSql.Append("D_XG_EVAL_DT=:D_XG_EVAL_DT,"); strSql.Append("C_ORDER_NO=:C_ORDER_NO"); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_QUEST_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_CUST_NAME", OracleDbType.Varchar2, 100), new OracleParameter(":C_CUST_CODE", OracleDbType.Varchar2, 100), new OracleParameter(":C_STL_GRD", OracleDbType.Varchar2, 500), new OracleParameter(":C_USE_DESC", OracleDbType.Varchar2, 300), new OracleParameter(":C_REMARK", OracleDbType.Varchar2, 500), new OracleParameter(":C_EMP_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP_NAME", OracleDbType.Varchar2, 20), new OracleParameter(":D_MOD_DT", OracleDbType.Date), new OracleParameter(":C_DEPT", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP", OracleDbType.Varchar2, 200), new OracleParameter(":D_PLAN_DT", OracleDbType.Date), new OracleParameter(":D_FINISH_DT", OracleDbType.Date), new OracleParameter(":C_REAL_TIME", OracleDbType.Varchar2, 300), new OracleParameter(":C_RESULT", OracleDbType.Varchar2, 300), new OracleParameter(":C_LEAVE_Q", OracleDbType.Varchar2, 300), new OracleParameter(":C_REMARK2", OracleDbType.Varchar2, 300), new OracleParameter(":N_CUST_EVAL", OracleDbType.Decimal, 15), new OracleParameter(":N_STATE", OracleDbType.Decimal, 1), new OracleParameter(":D_CUST_EVAL_DT", OracleDbType.Date), new OracleParameter(":N_XG_EVAL", OracleDbType.Decimal, 3), new OracleParameter(":C_XG_EVAL_EMP", OracleDbType.Varchar2, 100), new OracleParameter(":D_XG_EVAL_DT", OracleDbType.Date), new OracleParameter(":C_ORDER_NO", OracleDbType.Varchar2, 500), new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = model.C_QUEST_ID; parameters[1].Value = model.C_CUST_NAME; parameters[2].Value = model.C_CUST_CODE; parameters[3].Value = model.C_STL_GRD; parameters[4].Value = model.C_USE_DESC; parameters[5].Value = model.C_REMARK; parameters[6].Value = model.C_EMP_ID; parameters[7].Value = model.C_EMP_NAME; parameters[8].Value = model.D_MOD_DT; parameters[9].Value = model.C_DEPT; parameters[10].Value = model.C_EMP; parameters[11].Value = model.D_PLAN_DT; parameters[12].Value = model.D_FINISH_DT; parameters[13].Value = model.C_REAL_TIME; parameters[14].Value = model.C_RESULT; parameters[15].Value = model.C_LEAVE_Q; parameters[16].Value = model.C_REMARK2; parameters[17].Value = model.N_CUST_EVAL; parameters[18].Value = model.N_STATE; parameters[19].Value = model.D_CUST_EVAL_DT; parameters[20].Value = model.N_XG_EVAL; parameters[21].Value = model.C_XG_EVAL_EMP; parameters[22].Value = model.D_XG_EVAL_DT; parameters[23].Value = model.C_ORDER_NO; parameters[24].Value = model.C_ID; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TMC_TECH_CONSULT DataRowToModel(DataRow row) { Mod_TMC_TECH_CONSULT model = new Mod_TMC_TECH_CONSULT(); if (row != null) { if (row["C_ID"] != null) { model.C_ID = row["C_ID"].ToString(); } if (row["C_QUEST_ID"] != null) { model.C_QUEST_ID = row["C_QUEST_ID"].ToString(); } if (row["C_CUST_NAME"] != null) { model.C_CUST_NAME = row["C_CUST_NAME"].ToString(); } if (row["C_CUST_CODE"] != null) { model.C_CUST_CODE = row["C_CUST_CODE"].ToString(); } if (row["C_STL_GRD"] != null) { model.C_STL_GRD = row["C_STL_GRD"].ToString(); } if (row["C_USE_DESC"] != null) { model.C_USE_DESC = row["C_USE_DESC"].ToString(); } if (row["C_REMARK"] != null) { model.C_REMARK = row["C_REMARK"].ToString(); } if (row["C_EMP_ID"] != null) { model.C_EMP_ID = row["C_EMP_ID"].ToString(); } if (row["C_EMP_NAME"] != null) { model.C_EMP_NAME = row["C_EMP_NAME"].ToString(); } if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "") { model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString()); } if (row["C_DEPT"] != null) { model.C_DEPT = row["C_DEPT"].ToString(); } if (row["C_EMP"] != null) { model.C_EMP = row["C_EMP"].ToString(); } if (row["D_PLAN_DT"] != null && row["D_PLAN_DT"].ToString() != "") { model.D_PLAN_DT = DateTime.Parse(row["D_PLAN_DT"].ToString()); } if (row["D_FINISH_DT"] != null && row["D_FINISH_DT"].ToString() != "") { model.D_FINISH_DT = DateTime.Parse(row["D_FINISH_DT"].ToString()); } if (row["C_REAL_TIME"] != null) { model.C_REAL_TIME = row["C_REAL_TIME"].ToString(); } if (row["C_RESULT"] != null) { model.C_RESULT = row["C_RESULT"].ToString(); } if (row["C_LEAVE_Q"] != null) { model.C_LEAVE_Q = row["C_LEAVE_Q"].ToString(); } if (row["C_REMARK2"] != null) { model.C_REMARK2 = row["C_REMARK2"].ToString(); } if (row["N_CUST_EVAL"] != null && row["N_CUST_EVAL"].ToString() != "") { model.N_CUST_EVAL = decimal.Parse(row["N_CUST_EVAL"].ToString()); } if (row["N_STATE"] != null && row["N_STATE"].ToString() != "") { model.N_STATE = decimal.Parse(row["N_STATE"].ToString()); } if (row["D_CUST_EVAL_DT"] != null && row["D_CUST_EVAL_DT"].ToString() != "") { model.D_CUST_EVAL_DT = DateTime.Parse(row["D_CUST_EVAL_DT"].ToString()); } if (row["N_XG_EVAL"] != null && row["N_XG_EVAL"].ToString() != "") { model.N_XG_EVAL = decimal.Parse(row["N_XG_EVAL"].ToString()); } if (row["C_XG_EVAL_EMP"] != null) { model.C_XG_EVAL_EMP = row["C_XG_EVAL_EMP"].ToString(); } if (row["D_XG_EVAL_DT"] != null && row["D_XG_EVAL_DT"].ToString() != "") { model.D_XG_EVAL_DT = DateTime.Parse(row["D_XG_EVAL_DT"].ToString()); } if (row["C_ORDER_NO"] != null) { model.C_ORDER_NO = row["C_ORDER_NO"].ToString(); } } return(model); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //获取用户所属公司名称 var BaseUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"]; if (BaseUser != null) { GetFun();//加载按钮权限 pf(); ltlUserName.Text = BaseUser.Name; try { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { ltlID.Text = Request.QueryString["ID"]; Mod_TMC_TECH_CONSULT mod = tmc_tech_consult.GetModel(ltlID.Text); if (mod != null) { Mod_TMC_QUESTION modQuestion = tmc_question.GetModel(mod.C_QUEST_ID); ltlQuest.Text = modQuestion.C_NAME; ltlDT.Text = Convert.ToDateTime(mod.D_MOD_DT).ToString("yyy年MM月dd日"); ltlC_EMP_NAME.Text = mod.C_EMP_NAME; ltlSTL_GRD.Text = mod.C_STL_GRD; ltlCust.Text = mod.C_CUST_NAME; ltlUseDesc.Text = mod.C_USE_DESC; ltlQuestContent.Text = mod.C_REMARK; ltlCUSTEVAL.Text = mod.N_CUST_EVAL.ToString(); if (!string.IsNullOrEmpty(mod.D_PLAN_DT.ToString())) { Start.Value = Convert.ToDateTime(mod.D_PLAN_DT).ToString("yyy-MM-dd"); } else { Start.Value = DateTime.Now.ToString("yyy-MM-dd"); } if (!string.IsNullOrEmpty(mod.D_FINISH_DT.ToString())) { End.Value = Convert.ToDateTime(mod.D_FINISH_DT).ToString("yyy-MM-dd"); } else { End.Value = DateTime.Now.ToString("yyy-MM-dd"); } txtEmp.Value = mod.C_EMP; txtTIMECONTENT.Value = mod.C_REAL_TIME; txtRESULTCONTENT.Value = mod.C_RESULT; txtQUESTCONTENT.Value = mod.C_LEAVE_Q; txtRemark.Value = mod.C_REMARK2; dropNum.SelectedIndex = dropNum.Items.IndexOf(dropNum.Items.FindByText(mod.N_XG_EVAL.ToString())); EA.Visible = mod.N_STATE >= 2 ? false : true; //保存 EB.Visible = mod.N_STATE == 2 ? true : false; //评分 dropNum.Enabled = mod.N_STATE == 2 ? true : false; } } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } } } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TMC_TECH_CONSULT model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TMC_TECH_CONSULT("); strSql.Append("C_QUEST_ID,C_CUST_NAME,C_CUST_CODE,C_STL_GRD,C_USE_DESC,C_REMARK,C_EMP_ID,C_EMP_NAME,C_DEPT,C_EMP,D_PLAN_DT,D_FINISH_DT,C_REAL_TIME,C_RESULT,C_LEAVE_Q,C_REMARK2,N_CUST_EVAL,N_STATE,D_CUST_EVAL_DT,N_XG_EVAL,C_XG_EVAL_EMP,D_XG_EVAL_DT,C_ORDER_NO)"); strSql.Append(" values ("); strSql.Append(":C_QUEST_ID,:C_CUST_NAME,:C_CUST_CODE,:C_STL_GRD,:C_USE_DESC,:C_REMARK,:C_EMP_ID,:C_EMP_NAME,:C_DEPT,:C_EMP,:D_PLAN_DT,:D_FINISH_DT,:C_REAL_TIME,:C_RESULT,:C_LEAVE_Q,:C_REMARK2,:N_CUST_EVAL,:N_STATE,:D_CUST_EVAL_DT,:N_XG_EVAL,:C_XG_EVAL_EMP,:D_XG_EVAL_DT,:C_ORDER_NO)"); OracleParameter[] parameters = { new OracleParameter(":C_QUEST_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_CUST_NAME", OracleDbType.Varchar2, 100), new OracleParameter(":C_CUST_CODE", OracleDbType.Varchar2, 100), new OracleParameter(":C_STL_GRD", OracleDbType.Varchar2, 500), new OracleParameter(":C_USE_DESC", OracleDbType.Varchar2, 500), new OracleParameter(":C_REMARK", OracleDbType.Varchar2, 500), new OracleParameter(":C_EMP_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP_NAME", OracleDbType.Varchar2, 20), new OracleParameter(":C_DEPT", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP", OracleDbType.Varchar2, 200), new OracleParameter(":D_PLAN_DT", OracleDbType.Date), new OracleParameter(":D_FINISH_DT", OracleDbType.Date), new OracleParameter(":C_REAL_TIME", OracleDbType.Varchar2, 300), new OracleParameter(":C_RESULT", OracleDbType.Varchar2, 300), new OracleParameter(":C_LEAVE_Q", OracleDbType.Varchar2, 300), new OracleParameter(":C_REMARK2", OracleDbType.Varchar2, 300), new OracleParameter(":N_CUST_EVAL", OracleDbType.Decimal, 2), new OracleParameter(":N_STATE", OracleDbType.Decimal, 1), new OracleParameter(":D_CUST_EVAL_DT", OracleDbType.Date), new OracleParameter(":N_XG_EVAL", OracleDbType.Decimal, 2), new OracleParameter(":C_XG_EVAL_EMP", OracleDbType.Varchar2, 100), new OracleParameter(":D_XG_EVAL_DT", OracleDbType.Date), new OracleParameter(":C_ORDER_NO", OracleDbType.Varchar2, 500) }; parameters[0].Value = model.C_QUEST_ID; parameters[1].Value = model.C_CUST_NAME; parameters[2].Value = model.C_CUST_CODE; parameters[3].Value = model.C_STL_GRD; parameters[4].Value = model.C_USE_DESC; parameters[5].Value = model.C_REMARK; parameters[6].Value = model.C_EMP_ID; parameters[7].Value = model.C_EMP_NAME; parameters[8].Value = model.C_DEPT; parameters[9].Value = model.C_EMP; parameters[10].Value = model.D_PLAN_DT; parameters[11].Value = model.D_FINISH_DT; parameters[12].Value = model.C_REAL_TIME; parameters[13].Value = model.C_RESULT; parameters[14].Value = model.C_LEAVE_Q; parameters[15].Value = model.C_REMARK2; parameters[16].Value = model.N_CUST_EVAL; parameters[17].Value = model.N_STATE; parameters[18].Value = model.D_CUST_EVAL_DT; parameters[19].Value = model.N_XG_EVAL; parameters[20].Value = model.C_XG_EVAL_EMP; parameters[21].Value = model.D_XG_EVAL_DT; parameters[22].Value = model.C_ORDER_NO; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }