/// <summary> /// 添加/更新 /// </summary> /// <param name="list">参数</param> /// <returns></returns> public bool Insert_Update(Mod_TMD_HY_PLAN mod) { StringBuilder strSql = new StringBuilder(); if (mod.C_TYPE == "N") { #region //添加 strSql.Append("INSERT INTO TMD_HY_PLAN("); strSql.Append("C_REMARK,"); strSql.Append("C_EMP_NAME,"); strSql.Append("D_DT"); strSql.Append(")VALUES("); strSql.AppendFormat("'{0}',", mod.C_REMARK);//备注 strSql.AppendFormat("'{0}',", mod.C_EMP_NAME); strSql.AppendFormat("to_date('{0}','yyyy-mm-dd hh24:mi:ss')", mod.D_DT); strSql.Append(")"); #endregion } else { #region //更新 strSql.AppendFormat("UPDATE TMD_HY_PLAN SET "); strSql.AppendFormat("C_REMARK='{0}',", mod.C_REMARK); strSql.AppendFormat("C_EMP_NAME='{0}'", mod.C_EMP_NAME); strSql.AppendFormat(" WHERE C_ID='{0}'", mod.C_ID); #endregion } return(DbHelperOra.ExecuteSql(strSql.ToString()) > 0 ? true : false); }
protected void btnAdd_Click(object sender, EventArgs e) { try { Mod_TMD_HY_PLAN mod = new Mod_TMD_HY_PLAN(); if (string.IsNullOrEmpty(ltlID.Text)) { Bll_TRC_ROLL_PRODCUT trc_roll_prodcut = new Bll_TRC_ROLL_PRODCUT(); trc_roll_prodcut.ExeProc();//执行钢坯/线材库存类型 } mod.C_TYPE = ltlID.Text == "" ? "N" : "Y"; mod.C_REMARK = txtRemark.Text; mod.C_EMP_NAME = ltlEmpName.Text; mod.D_DT = Convert.ToDateTime(txtStart.Value); mod.C_ID = ltlID.Text; if (tmd_hy_plan.Insert_Update(mod)) { WebMsg.MessageBox("保存成功"); GetList(); } } catch (Exception ex) { WebMsg.MessageBox(ex.Message); } }
protected void btndel_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ltlID.Text)) { Mod_TMD_HY_PLAN mod = new Mod_TMD_HY_PLAN(); mod.C_ID = ltlID.Text; if (tmd_hy_plan.Del(mod)) { WebMsg.MessageBox("删除成功"); GetList(); } } }
/// <summary> /// 添加/更新 /// </summary> /// <param name="list">参数</param> /// <returns></returns> public bool Insert_Update(Mod_TMD_HY_PLAN mod) { return(dal.Insert_Update(mod)); }
public bool Del(Mod_TMD_HY_PLAN mod) { return(dal.Del(mod)); }
public bool Del(Mod_TMD_HY_PLAN mod) { string strSql = $@"DELETE FROM TMD_HY_PLAN T WHERE T.C_ID='{mod.C_ID}'"; return(DbHelperOra.ExecuteSql(strSql) > 0 ? true : false); }