Ejemplo n.º 1
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(CRM_ZoneParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.ZID == null)
                {
                    throw new WarnException("请指定要删除的记录!");
                }
                #endregion
                WhereClip where = GetWhereClip(param);
                CRM_ZoneResult info = new CRM_ZoneResult();
                info.IsDeleted = true;
                affect         = this.Update <CRM_ZoneResult>(info, where);
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public CRM_ZoneResult GetInfo(CRM_ZoneParam param)
        {
            CRM_ZoneResult ret = new CRM_ZoneResult();
            ExeResult      rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_ZoneBLL", "GetInfo", param);
            ret = rst == null ? new CRM_ZoneResult() : rst.Result as CRM_ZoneResult;
            return(ret);
        }
Ejemplo n.º 3
0
        public WCFAddUpdateResult AddOrUpdate(CRM_ZoneResult param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_ZoneBLL", "AddOrUpdate", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public CRM_ZoneResult GetInfo(CRM_ZoneParam param)
        {
            this.CheckSession();
            CRM_ZoneResult rst = new CRM_ZoneResult();

            #region 获取实体
            rst = this.Select <CRM_ZoneResult>(GetWhereClip(param));
            #endregion
            return(rst);
        }
Ejemplo n.º 5
0
 private void ucButton1_Click(object sender, EventArgs e)
 {
     if (this.bsZone.Current != null)
     {
         int            zid       = 0;
         CRM_ZoneResult delResult = this.bsZone.Current as CRM_ZoneResult;
         zid = delResult.ZID.ToInt32();
         if (zid > 0)
         {
             delResult.IsDeleted = true;
             delList.Add(delResult);
         }
         bsZone.RemoveCurrent();
     }
 }
Ejemplo n.º 6
0
 private void CascadingDropDown(Controls.UcComboBox c, Controls.UcComboBox pc, int ztype)
 {
     if (pc.Text.Trim() != "")
     {
         CRM_ZoneResult rst = zoneLogic.GetInfo(new CRM_ZoneParam {
             Name_CN = pc.Text
         });
         if (rst != null)
         {
             zoneLogic.BindComboBox(c, new CRM_ZoneParam {
                 ZType = ztype, PZID = rst.ZID
             });
         }
         else
         {
             c.DataSource = null;
         }
     }
     else
     {
         c.DataSource = null;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 添加和新增修改
        /// </summary>
        /// <param name="param">新增或修改的实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult AddOrUpdate(CRM_ZoneResult param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                int affect = 0;
                #region 判断
                if (param.ZID == 0)
                {
                    throw new  WarnException("请输入区域ID!");
                }
                if (param.Name_CN.Trim() == "")
                {
                    throw new WarnException("请输入区域名称!");
                }
                #endregion

                #region 判断重复
                WhereClip whereChk = CRM_Zone._.Name_CN == param.Name_CN;
                if (param.ZID > 0)
                {
                    whereChk = whereChk && CRM_Zone._.ZID != param.ZID;
                }
                int chkNum = this.Count <CRM_ZoneResult>(whereChk);
                if (chkNum > 0)
                {
                    throw new WarnException("存在重复的区域名称!");
                }
                #endregion

                #region 系统默认值
                if (param.ZID != 0)
                {
                    WhereClip where = CRM_Zone._.ZID == param.ZID;
                    affect          = this.Update <CRM_ZoneResult>(param, where);
                }
                else
                {
                    param.ZGuID      = Guid.NewGuid();
                    param.GCompanyID = this.SessionInfo.CompanyID;
                    param.IsDeleted  = false;
                    affect           = this.Insert <CRM_ZoneResult>(param);
                    param            = this.Select <CRM_ZoneResult>(new List <Field>()
                    {
                        CRM_Zone._.ZID
                    }, CRM_Zone._.Name_CN == param.Name_CN);
                }
                #region 设置返回值
                ret.Key     = param.ZID;
                ret.KeyGuid = param.ZGuID;
                #endregion

                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }