Beispiel #1
0
        //走访台账记录
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Mod_TMC_CUST_BOOK mod = new Mod_TMC_CUST_BOOK();

            mod.D_ZF_DT        = Convert.ToDateTime(txtD_ZF_DT.Value);
            mod.C_CUST_NAME    = txtC_CUST_NAME.Text;
            mod.C_AREA         = dropArea.SelectedValue;
            mod.C_CUST_MANAGE  = txtC_CUST_MANAGE.Text;
            mod.C_CUST_EMP     = txtC_CUST_EMP.Text;
            mod.C_CUST_EMP_TEL = txtC_CUST_EMP_TEL.Text;
            mod.C_MEETING_CUST = txtC_MEETING_CUST.Text;
            mod.C_MEETING_XG   = txtC_MEETING_XG.Text;
            mod.C_MAIN_CONTENT = txtC_MAIN_CONTENT.Text;
            mod.C_NEED_S_Q     = txtC_NEED_S_Q.Text;
            mod.C_LEAVE_Q      = txtC_LEAVE_Q.Text;
            mod.C_STL_GRD      = txtC_STL_GRD.Text;
            mod.C_PRO_USE      = txtC_PRO_USE.Text;
            mod.C_SITE         = txtC_SITE.Text;
            mod.C_REMARK       = txtC_REMARK.Text;
            mod.N_TYPE         = Convert.ToDecimal(droptype.SelectedValue);
            mod.C_EMPID        = ltlempID.Text;
            if (tmc_cust_book.Add(mod))
            {
                WebMsg.MessageBox("保存成功", "Cust_BookAdd.aspx");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TMC_CUST_BOOK model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TMC_CUST_BOOK(");
            strSql.Append("C_ID,D_ZF_DT,C_CUST_NAME,C_AREA,C_CUST_MANAGE,C_CUST_EMP,C_CUST_EMP_TEL,C_MEETING_CUST,C_MEETING_XG,C_MAIN_CONTENT,C_NEED_S_Q,C_LEAVE_Q,C_STL_GRD,C_PRO_USE,C_SITE,C_REMARK,N_TYPE,C_EMPID)");
            strSql.Append(" values (");
            strSql.Append(":C_ID,:D_ZF_DT,:C_CUST_NAME,:C_AREA,:C_CUST_MANAGE,:C_CUST_EMP,:C_CUST_EMP_TEL,:C_MEETING_CUST,:C_MEETING_XG,:C_MAIN_CONTENT,:C_NEED_S_Q,:C_LEAVE_Q,:C_STL_GRD,:C_PRO_USE,:C_SITE,:C_REMARK,:N_TYPE,:C_EMPID)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",           OracleDbType.Varchar2, 100),
                new OracleParameter(":D_ZF_DT",        OracleDbType.Date),
                new OracleParameter(":C_CUST_NAME",    OracleDbType.Varchar2, 200),
                new OracleParameter(":C_AREA",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_MANAGE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_EMP",     OracleDbType.Varchar2, 200),
                new OracleParameter(":C_CUST_EMP_TEL", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MEETING_CUST", OracleDbType.Varchar2, 300),
                new OracleParameter(":C_MEETING_XG",   OracleDbType.Varchar2, 300),
                new OracleParameter(":C_MAIN_CONTENT", OracleDbType.Varchar2, 500),
                new OracleParameter(":C_NEED_S_Q",     OracleDbType.Varchar2, 500),
                new OracleParameter(":C_LEAVE_Q",      OracleDbType.Varchar2, 500),
                new OracleParameter(":C_STL_GRD",      OracleDbType.Varchar2, 300),
                new OracleParameter(":C_PRO_USE",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_SITE",         OracleDbType.Varchar2, 200),
                new OracleParameter(":C_REMARK",       OracleDbType.Varchar2, 500),
                new OracleParameter(":N_TYPE",         OracleDbType.Decimal,    1),
                new OracleParameter(":C_EMPID",        OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ID;
            parameters[1].Value  = model.D_ZF_DT;
            parameters[2].Value  = model.C_CUST_NAME;
            parameters[3].Value  = model.C_AREA;
            parameters[4].Value  = model.C_CUST_MANAGE;
            parameters[5].Value  = model.C_CUST_EMP;
            parameters[6].Value  = model.C_CUST_EMP_TEL;
            parameters[7].Value  = model.C_MEETING_CUST;
            parameters[8].Value  = model.C_MEETING_XG;
            parameters[9].Value  = model.C_MAIN_CONTENT;
            parameters[10].Value = model.C_NEED_S_Q;
            parameters[11].Value = model.C_LEAVE_Q;
            parameters[12].Value = model.C_STL_GRD;
            parameters[13].Value = model.C_PRO_USE;
            parameters[14].Value = model.C_SITE;
            parameters[15].Value = model.C_REMARK;
            parameters[16].Value = model.N_TYPE;
            parameters[17].Value = model.C_EMPID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        public AjaxResult AddBook([FromBody] dynamic Json)
        {
            AjaxResult result = new AjaxResult();

            #region                                  //接收参数
            string zf_dt        = Json.zf_dt;        //走访日期
            string cust_name    = Json.cust_name;    //客户名称
            string area         = Json.area;         //区域
            string cust_manage  = Json.cust_manage;  //客户经理
            string cust_emp     = Json.cust_emp;     //客户人员
            string cust_emp_tel = Json.cust_emp_tel; //客户人员电话
            string meeting_cust = Json.meeting_cust; //参会客户名单
            string meeting_xg   = Json.meeting_xg;   //参会邢钢名单
            string main_content = Json.main_content; //主要交流内容
            string need_s_q     = Json.need_s_q;     //需解决问题
            string leave_q      = Json.leave_q;      //遗留问题
            string stl_grd      = Json.stl_grd;      //钢种
            string pro_use      = Json.pro_use;      //用途
            string site         = Json.site;         //交流地点
            string remark       = Json.remark;       //备注
            string type         = Json.type;         //0:走访用户,1来访客户
            #endregion

            #region //数据操作
            result.Code = DoResult.Success;
            Mod_TS_USER modUser = GetUserID();

            Mod_TMC_CUST_BOOK mod = new Mod_TMC_CUST_BOOK();
            mod.D_ZF_DT        = Convert.ToDateTime(zf_dt);
            mod.C_CUST_NAME    = cust_name;
            mod.C_AREA         = area;
            mod.C_CUST_MANAGE  = cust_manage;
            mod.C_CUST_EMP     = cust_emp;
            mod.C_CUST_EMP_TEL = cust_emp_tel;
            mod.C_MEETING_CUST = meeting_cust;
            mod.C_MEETING_XG   = meeting_xg;
            mod.C_MAIN_CONTENT = main_content;
            mod.C_NEED_S_Q     = need_s_q;
            mod.C_LEAVE_Q      = leave_q;
            mod.C_STL_GRD      = stl_grd;
            mod.C_PRO_USE      = pro_use;
            mod.C_SITE         = site;
            mod.C_REMARK       = remark;
            mod.N_TYPE         = Convert.ToDecimal(type);
            mod.C_EMPID        = modUser.C_ID;
            if (tmc_cust_book.Add(mod))
            {
                result.Result = "录入成功!";
            }
            else
            {
                result.Result = "录入失败!";
            }

            #endregion

            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMC_CUST_BOOK GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,D_ZF_DT,C_CUST_NAME,C_AREA,C_CUST_MANAGE,C_CUST_EMP,C_CUST_EMP_TEL,C_MEETING_CUST,C_MEETING_XG,C_MAIN_CONTENT,C_NEED_S_Q,C_LEAVE_Q,C_STL_GRD,C_PRO_USE,C_SITE,C_REMARK,N_TYPE from TMC_CUST_BOOK ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMC_CUST_BOOK model = new Mod_TMC_CUST_BOOK();
            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 bool Update(Mod_TMC_CUST_BOOK model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TMC_CUST_BOOK model)
 {
     return(dal.Add(model));
 }
Beispiel #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMC_CUST_BOOK DataRowToModel(DataRow row)
        {
            Mod_TMC_CUST_BOOK model = new Mod_TMC_CUST_BOOK();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["D_ZF_DT"] != null && row["D_ZF_DT"].ToString() != "")
                {
                    model.D_ZF_DT = DateTime.Parse(row["D_ZF_DT"].ToString());
                }
                if (row["C_CUST_NAME"] != null)
                {
                    model.C_CUST_NAME = row["C_CUST_NAME"].ToString();
                }
                if (row["C_AREA"] != null)
                {
                    model.C_AREA = row["C_AREA"].ToString();
                }
                if (row["C_CUST_MANAGE"] != null)
                {
                    model.C_CUST_MANAGE = row["C_CUST_MANAGE"].ToString();
                }
                if (row["C_CUST_EMP"] != null)
                {
                    model.C_CUST_EMP = row["C_CUST_EMP"].ToString();
                }
                if (row["C_CUST_EMP_TEL"] != null)
                {
                    model.C_CUST_EMP_TEL = row["C_CUST_EMP_TEL"].ToString();
                }
                if (row["C_MEETING_CUST"] != null)
                {
                    model.C_MEETING_CUST = row["C_MEETING_CUST"].ToString();
                }
                if (row["C_MEETING_XG"] != null)
                {
                    model.C_MEETING_XG = row["C_MEETING_XG"].ToString();
                }
                if (row["C_MAIN_CONTENT"] != null)
                {
                    model.C_MAIN_CONTENT = row["C_MAIN_CONTENT"].ToString();
                }
                if (row["C_NEED_S_Q"] != null)
                {
                    model.C_NEED_S_Q = row["C_NEED_S_Q"].ToString();
                }
                if (row["C_LEAVE_Q"] != null)
                {
                    model.C_LEAVE_Q = row["C_LEAVE_Q"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
                if (row["C_PRO_USE"] != null)
                {
                    model.C_PRO_USE = row["C_PRO_USE"].ToString();
                }
                if (row["C_SITE"] != null)
                {
                    model.C_SITE = row["C_SITE"].ToString();
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["N_TYPE"] != null && row["N_TYPE"].ToString() != "")
                {
                    model.N_TYPE = decimal.Parse(row["N_TYPE"].ToString());
                }
            }
            return(model);
        }
Beispiel #8
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TMC_CUST_BOOK model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TMC_CUST_BOOK set ");
            strSql.Append("D_ZF_DT=:D_ZF_DT,");
            strSql.Append("C_CUST_NAME=:C_CUST_NAME,");
            strSql.Append("C_AREA=:C_AREA,");
            strSql.Append("C_CUST_MANAGE=:C_CUST_MANAGE,");
            strSql.Append("C_CUST_EMP=:C_CUST_EMP,");
            strSql.Append("C_CUST_EMP_TEL=:C_CUST_EMP_TEL,");
            strSql.Append("C_MEETING_CUST=:C_MEETING_CUST,");
            strSql.Append("C_MEETING_XG=:C_MEETING_XG,");
            strSql.Append("C_MAIN_CONTENT=:C_MAIN_CONTENT,");
            strSql.Append("C_NEED_S_Q=:C_NEED_S_Q,");
            strSql.Append("C_LEAVE_Q=:C_LEAVE_Q,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("C_PRO_USE=:C_PRO_USE,");
            strSql.Append("C_SITE=:C_SITE,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("N_TYPE=:N_TYPE");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":D_ZF_DT",        OracleDbType.Date),
                new OracleParameter(":C_CUST_NAME",    OracleDbType.Varchar2, 200),
                new OracleParameter(":C_AREA",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_MANAGE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_EMP",     OracleDbType.Varchar2, 200),
                new OracleParameter(":C_CUST_EMP_TEL", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MEETING_CUST", OracleDbType.Varchar2, 300),
                new OracleParameter(":C_MEETING_XG",   OracleDbType.Varchar2, 300),
                new OracleParameter(":C_MAIN_CONTENT", OracleDbType.Varchar2, 500),
                new OracleParameter(":C_NEED_S_Q",     OracleDbType.Varchar2, 500),
                new OracleParameter(":C_LEAVE_Q",      OracleDbType.Varchar2, 500),
                new OracleParameter(":C_STL_GRD",      OracleDbType.Varchar2, 300),
                new OracleParameter(":C_PRO_USE",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_SITE",         OracleDbType.Varchar2, 200),
                new OracleParameter(":C_REMARK",       OracleDbType.Varchar2, 500),
                new OracleParameter(":N_TYPE",         OracleDbType.Decimal,    1),
                new OracleParameter(":C_ID",           OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.D_ZF_DT;
            parameters[1].Value  = model.C_CUST_NAME;
            parameters[2].Value  = model.C_AREA;
            parameters[3].Value  = model.C_CUST_MANAGE;
            parameters[4].Value  = model.C_CUST_EMP;
            parameters[5].Value  = model.C_CUST_EMP_TEL;
            parameters[6].Value  = model.C_MEETING_CUST;
            parameters[7].Value  = model.C_MEETING_XG;
            parameters[8].Value  = model.C_MAIN_CONTENT;
            parameters[9].Value  = model.C_NEED_S_Q;
            parameters[10].Value = model.C_LEAVE_Q;
            parameters[11].Value = model.C_STL_GRD;
            parameters[12].Value = model.C_PRO_USE;
            parameters[13].Value = model.C_SITE;
            parameters[14].Value = model.C_REMARK;
            parameters[15].Value = model.N_TYPE;
            parameters[16].Value = model.C_ID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }