Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public override void Confirm()
        {
            List <EntityPromotionPlan> lstRecord = null;

            if (this.gvPromotionRecord.SelectedRowsCount > 0)
            {
                lstRecord = new List <EntityPromotionPlan>();
                for (int i = this.gvPromotionRecord.RowCount - 1; i >= 0; i--)
                {
                    if (this.gvPromotionRecord.IsRowSelected(i))
                    {
                        EntityDisplayPromotionPlan displayVo = this.gvPromotionRecord.GetRow(i) as EntityDisplayPromotionPlan;
                        EntityPromotionPlan        vo        = new EntityPromotionPlan();
                        vo.id         = displayVo.id;
                        vo.auditState = "2";
                        lstRecord.Add(vo);
                    }
                }
            }

            if (lstRecord != null)
            {
                using (ProxyHms proxy = new ProxyHms())
                {
                    if (proxy.Service.ConfirmPromotionRecord(lstRecord) > 0)
                    {
                        DialogBox.Msg("审核成功!");
                        Init();
                    }
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 干预计划转为干预记录
 /// </summary>
 /// <param name="promotionPlan"></param>
 /// <returns></returns>
 public int SavePromotionRecord(EntityPromotionPlan promotionPlan)
 {
     using (Biz204 biz = new Biz204())
     {
         return(biz.SavePromotionRecord(promotionPlan));
     }
 }
Esempio n. 3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (promotionPlan == null)
            {
                return;
            }

            EntityPromotionPlan planRecord = new EntityPromotionPlan();

            planRecord = Function.MapperToModel(planRecord, promotionPlan);
            planRecord.planVisitRecord = memVisitRecord.Text;
            planRecord.planRemind      = memPlanRemind.Text;
            planRecord.planWay         = lstPromtionWays.Find(r => r.planWay == planRecord.planWay).id;
            planRecord.planContent     = lstPromotionContents.Find(r => r.planContent == planRecord.planContent).id;
            string recordPlanWay = cboPlanways.Text;

            planRecord.recordWay = lstPromtionWays.Find(r => r.planWay == recordPlanWay).id;
            string recordPlanContent = cboPlanContent.Text;

            planRecord.recordContent = lstPromotionContents.Find(r => r.planContent == recordPlanContent).id;
            string planPleasedLevel = cboCooperate.Text;

            planRecord.executeTime   = DateTime.Now;
            planRecord.executeUserId = "00";
            planRecord.planState     = "1";
            using (ProxyHms proxy = new ProxyHms())
            {
                if (proxy.Service.SavePromotionRecord(planRecord) > 0)
                {
                    DialogBox.Msg("计划执行成功!");
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="promotionPlan"></param>
        /// <returns></returns>
        public int SavePromotionRecord(EntityPromotionPlan promotionPlan)
        {
            int affect = -1;

            if (promotionPlan == null)
            {
                return(affect);
            }
            SqlHelper svc = null;

            try
            {
                svc = new SqlHelper(EnumBiz.onlineDB);
                List <DacParm> lstParm = new List <DacParm>();

                lstParm.Add(svc.GetUpdateParm(promotionPlan, new List <string>()
                {
                    EntityPromotionPlan.Columns.planState,
                    EntityPromotionPlan.Columns.planWay,
                    EntityPromotionPlan.Columns.planContent,
                    EntityPromotionPlan.Columns.planRemind,
                    EntityPromotionPlan.Columns.planVisitRecord,
                    EntityPromotionPlan.Columns.recordWay,
                    EntityPromotionPlan.Columns.recordContent,
                    EntityPromotionPlan.Columns.executeTime,
                    EntityPromotionPlan.Columns.executeUserId
                },
                                              new List <string>()
                {
                    EntityPromotionPlan.Columns.id
                }));

                if (lstParm.Count > 0)
                {
                    affect = svc.Commit(lstParm);
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.OutPutException(ex);
            }
            finally
            {
                svc = null;
            }

            return(affect);
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        public override void Complete()
        {
            int affect = -1;
            List <EntityPromotionPlan> data = new List <EntityPromotionPlan>();

            if (lstSelectClient.Count <= 0)
            {
                DialogBox.Msg("请选择客户!");
                return;
            }

            if (lstPromotionSelect.Count <= 0)
            {
                DialogBox.Msg("请选择干预模板");
                return;
            }

            foreach (var client in lstSelectClient)
            {
                if (lstPromotionSelect.Count > 0)
                {
                    foreach (var promotion in lstPromotionSelect)
                    {
                        EntityPromotionPlan plan = new EntityPromotionPlan();
                        plan.clientId   = client.clientNo;
                        plan.planType   = "4";
                        plan.planDate   = Function.Datetime(promotion.planPeriod);
                        plan.planState  = "2";
                        plan.auditState = chkConfirm.Checked ? "3" : "1";
                        string planWay     = dicPromotionWayConfig.Find(r => r.planWay == promotion.planWay).id;
                        string planContent = dicPromotionContentConfig.Find(r => r.planContent == promotion.planContent).id;
                        plan.planWay     = planWay;
                        plan.planContent = planContent;
                        plan.planRemind  = promotion.planRemind;
                        plan.ignorPlan   = "2";
                        plan.planState   = "2";
                        if (chkConfirm.Checked == true)
                        {
                            plan.auditState = "3";
                        }
                        plan.regTimes   = client.regTimes;
                        plan.createId   = "00";
                        plan.createDate = DateTime.Now;

                        data.Add(plan);
                    }
                }
            }

            if (data.Count > 0)
            {
                using (ProxyHms proxy = new ProxyHms())
                {
                    affect = proxy.Service.SavePromotionPan(data);
                }
            }

            if (affect > 0)
            {
                Init();
                DialogBox.Msg("保存成功!");
            }
            else
            {
                DialogBox.Msg("保存失败!");
            }
        }