Esempio n. 1
0
        private static int Update(Model.Lcgl.Lc_fzmd xm)
        {
            //xm.Ztdm = (int)TStar.Web.Globals.SystemSetting.Status.Submitted;
            int r = Update <Model.Lcgl.Lc_fzmd>(xm);

            // 写日志

            return(r);
        }
Esempio n. 2
0
        private static int Insert(Model.Lcgl.Lc_fzmd xm)
        {
            xm.Xq   = BLL.Globals.SystemSetting.Dqxq;
            xm.Ztdm = (int)TStar.Web.Globals.SystemSetting.Status.Draft;
            int r = Insert <Model.Lcgl.Lc_fzmd>(xm);

            // 写日志

            return(r);
        }
Esempio n. 3
0
        /// <summary>
        /// 保存名单
        /// </summary>
        public static bool Save(Model.Lcgl.Lc_fzmd xm)
        {
            int r = 0;

            if (String.IsNullOrEmpty(xm.Pkid)) // 新增
            {
                r = Insert(xm);
            }
            else // 保存
            {
                r = Update(xm);
            }

            return(r > 0);
        }
Esempio n. 4
0
        /// <summary>
        /// 导入发展对象
        /// </summary>
        protected int ImportFzmd(DataRowView drv, string drsj)
        {
            int cnt = 0;

            string[] columns = Columns;
            string   xh      = drv[columns[0]].ToString().Trim();
            string   xm      = drv[columns[1]].ToString().Trim();
            string   bmbh    = TStar.Web.Globals.Account.DeptPkid;
            string   dzbbh   = BLL.Globals.SystemSetting.IsCommittee ? null : TStar.Web.Globals.Account.UserInfo.Dzbbh;

            Model.Jcgl.Jc_xs xs = BLL.Jcgl.Jc_xs.GetEntity(bmbh, dzbbh, xh, xm);
            if (string.IsNullOrEmpty(xs.Pkid))
            {
                throw new Exception("该学生信息不存在。");
            }
            if (BLL.Lcgl.Lc_fzmd.Exist(xs.Pkid))
            {
                throw new Exception("该名单已导入。");
            }
            if (int.Parse(xs.Fzztdm) != (int)TStar.Web.Globals.SystemSetting.Fzzt.Nfzdx)
            {
                throw new Exception("该学生不是拟发展对象。");
            }

            string bjjg   = drv[columns[2]].ToString().Trim();
            string bjjgdm = TU.Globals.BindSystemCode(BLL.Globals.SystemCode.DtDm_jgzt, null, "Mc", "Dm", bjjg, "");

            if (bjjgdm == "")
            {
                throw new Exception(columns[2] + "不正确。");
            }

            DateTime dt;
            string   zbdhrq = drv[columns[3]].ToString().Trim();

            if (zbdhrq.Length < 8)
            {
                throw new Exception(columns[3] + "不正确。");
            }
            zbdhrq = string.Format("{0}-{1}-{2}", zbdhrq.Substring(0, 4), zbdhrq.Substring(4, 2), zbdhrq.Substring(6, 2));
            if (!DateTime.TryParse(zbdhrq, out dt))
            {
                throw new Exception(columns[3] + "不正确。");
            }

            string zysbh = drv[columns[4]].ToString().Trim();

            if (string.IsNullOrEmpty(zysbh))
            {
                throw new Exception(columns[4] + "不能为空。");
            }

            string bz = drv[columns[5]].ToString().Trim();

            Model.Lcgl.Lc_fzmd m = new Model.Lcgl.Lc_fzmd();
            m.Bmbh   = bmbh;
            m.Dzbbh  = xs.Dzbbh;
            m.Xsbh   = xs.Pkid;
            m.Bjjgdm = bjjgdm;
            m.Zbdhrq = zbdhrq;
            m.Zysbh  = zysbh;
            m.Bz     = bz;
            m.Drsj   = drsj;
            if (BLL.Lcgl.Lc_fzmd.Save(m))
            {
                cnt        = 1;
                drv["Del"] = 1;
            }

            return(cnt);
        }