Example #1
0
        private void EnsureCompanyType(SYS_ChargeRecordResult charge)
        {
            //判断当前用户是什么类型用户
            if (charge == null || charge.ChargeEndTime == null)
            {
                MySession.MemberType = (int)ZNLCRM.Utility.CommonEnum.MemberType.Free; //标志为免费用户
                return;
            }

            var remanSpan = charge.ChargeEndTime.Value.ToString("yyyy-MM-dd").ToDateTime() -
                            WCFBLL.GetServerTime().Value.ToString("yyyy-MM-dd").ToDateTime();

            MySession.RemainDays = remanSpan.Days;
            if (remanSpan.Days < 0)
            {
                MySession.MemberType = (int)ZNLCRM.Utility.CommonEnum.MemberType.Free; //标志为免费用户
            }
            else if (charge.ChargeType == 5)
            {
                MySession.MemberType = (int)ZNLCRM.Utility.CommonEnum.MemberType.Trialed; //试用用户
            }
            else
            {
                MySession.MemberType = (int)ZNLCRM.Utility.CommonEnum.MemberType.Paied; //收费用户
            }
        }
Example #2
0
        public void GetGridColListInForm(List <UcDataGridView> lstDgv)
        {
            _isFormPeriod = true;
            #region 获取相关的参数
            List <string> lstGridNames = new List <string>();
            List <string> lstFormName  = new List <string>();
            List <string> lstUConName  = new List <string>();
            string        name         = "";
            foreach (UcDataGridView dgv in lstDgv)
            {
                lstGridNames.Add(dgv.Name);
                name = dgv.FindForm().Name;
                if (!lstFormName.Contains(name))
                {
                    lstFormName.Add(dgv.FindForm().Name);
                }

                Control parentCon = dgv.Parent;
                while (parentCon != null && parentCon.GetType().BaseType != typeof(ucBaseUserControl))
                {
                    parentCon = parentCon.Parent;
                }
                if (parentCon != null)
                {
                    name = (parentCon as ucBaseUserControl).Name;
                    if (!lstUConName.Contains(name))
                    {
                        lstUConName.Add(name);
                    }
                }
            }
            #endregion
            #region 设置相关窗体表格变量
            SYS_DataGridParam param = new SYS_DataGridParam()
            {
                ParentNames = lstUConName.ToArray(),
                GridNames   = lstGridNames.ToArray(),
                FormNames   = lstFormName.ToArray()
            };
            ExeResult rst = WCFBLL.Execute("ZNLCRM.BLL.Sys.SYS_DataGridBLL", "GetGridColList", param);
            if (rst.Complete == ExeComplete.ErrorEx)
            {
                MessageBox.Show(rst.DebugMsg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (rst.Complete == ExeComplete.WarnEx)
            {
                MessageBox.Show(rst.Message, "警告提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (rst.Complete == ExeComplete.Succeed)
            {
                DataGridSettingInForm = rst.Result as List <SYS_DataGridResult>;
            }
            #endregion
        }
Example #3
0
        /// <summary>
        /// WCF方法是否运行成功
        /// </summary>
        /// <param name="result">WCF运行结果</param>
        /// <returns>是否成功</returns>
        protected bool IsWcfExeSuccess(ExeResult result)
        {
            bool   bRet   = true;
            string strErr = WCFBLL.AnalysisExeResult(result);

            if (!string.IsNullOrEmpty(strErr))
            {
                ShowMessage(strErr);
                bRet = false;
            }
            return(bRet);
        }
Example #4
0
        public ExeResult UserLogin(SYS_UserAccountParam param)
        {
            string ipAddress  = EnvironmentHandler.GetNetCardIP();
            string macAddress = EnvironmentHandler.GetNetCardMAC(ipAddress);

            param.ClientIP    = ipAddress;
            param.MacAddress  = macAddress;
            param.HardSN      = EnvironmentHandler.GetHardSN();
            param.PartnerCode = MySession.PartnerCode;
            //string usedQuoteAgent = ManagerAppConfig.GetAppConfig(Constant.EnableQuoteAgent);
            //param.IsSearchByNew = string.IsNullOrEmpty(usedQuoteAgent) || usedQuoteAgent == "1";

            MySession.ClientIP   = ipAddress;
            MySession.MacAddress = macAddress;
            return(WCFBLL.Execute("ZNLCRM.BLL.Account.SYS_UserAccountBLL", "UserLogin", param));
        }
Example #5
0
        //public static DateTime? GetServerNow()
        //{
        //    return WCFBLL.GetServerTime();
        //}

        public static string GetServerNow(bool includeTime)
        {
            DateTime?now     = WCFBLL.GetServerTime().ToDateTime();
            string   retDate = "";

            if (now != null)
            {
                if (includeTime)
                {
                    retDate = now.Value.ToString("yyyy-MM-dd hh:mm:ss");
                }
                else
                {
                    retDate = now.Value.ToString("yyyy-MM-dd");
                }
            }
            return(retDate);
        }
Example #6
0
        /// <summary>
        /// 初始化全局的参数
        /// </summary>
        public void InitGlobalVars()
        {
            //获取服务器时间,并设置本机时间
            DateTime?sDateTime = WCFBLL.GetServerTime();

            if (sDateTime != null)
            {
                WinApi.SetLocalTime((DateTime)sDateTime);
            }

            #region 设置最大接收数
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding[@name='ZNLERP.Mini.Server.Adapter']", "maxBufferSize", "45536000");
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding[@name='ZNLERP.Mini.Server.Adapter']", "maxReceivedMessageSize", "45536000");
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding[@name='ZNLERP.Mini.Server.Adapter']", "maxBufferPoolSize", "52428800");
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding[@name='ZNLERP.Mini.Server.Adapter']", "closeTimeout", "00:05:00");
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding[@name='ZNLERP.Mini.Server.Adapter']", "openTimeout", "00:05:00");
            ManagerAppConfig.SetAppConfigKeyValue("configuration/system.serviceModel/bindings/basicHttpBinding/binding/readerQuotas", "maxArrayLength", "16384000");
            #endregion
        }
Example #7
0
        private void GetGridColSetList(SYS_DataGridParam param)
        {
            List <SYS_DataGridResult> ret = new List <SYS_DataGridResult>();
            ExeResult rst = WCFBLL.Execute("ZNLCRM.BLL.Sys.SYS_DataGridBLL", "GetGridColList", param);

            if (rst.Complete == ExeComplete.ErrorEx)
            {
                MessageBox.Show(rst.DebugMsg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (rst.Complete == ExeComplete.WarnEx)
            {
                MessageBox.Show(rst.Message, "警告提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (rst.Complete == ExeComplete.Succeed)
            {
                ret = rst.Result as List <SYS_DataGridResult>;
                SetDataGridSettingVar(ret);
            }
        }
Example #8
0
        protected ExeResult Execute(string nameSpaceClassFullName, string methodName, object param)
        {
            ExeResult rst = new ExeResult();

            rst = WCFBLL.Execute(nameSpaceClassFullName, methodName, param);
            string info = AnalysisExeResult(rst);

            if (!string.IsNullOrEmpty(info))
            {
                if (_form != null)
                {
                    Action <string> showMsg = ShowMessage;
                    if (this._form.IsHandleCreated)
                    {
                        this._form.Invoke(showMsg, info);
                    }
                }
                rst = null;
            }
            return(rst);
        }
Example #9
0
 /// <summary>
 /// 获得公司的购买服务的记录
 /// </summary>
 /// <param name="param"></param>
 /// <returns></returns>
 public ExeResult GetChargeRecord(SYS_CompanyInfoParam param)
 {
     return(WCFBLL.Execute("ZNLCRM.BLL.Account.SYS_CompanyInfoBLL", "GetChargeRecord", param));
 }
Example #10
0
        public int SaveGridSet()
        {
            int ret = 0;
            List <SYS_DataGridResult> saveList = new List <SYS_DataGridResult>();

            foreach (SYS_DataGridResult info in DataGridSetting)
            {
                List <SYS_UserGridColIndex> indexList = new List <SYS_UserGridColIndex>();
                List <SYS_UserGridColWidth> widthList = new List <SYS_UserGridColWidth>();
                List <SYS_UserGridColName>  nameList  = new List <SYS_UserGridColName>();
                foreach (SYS_UserGridColIndex infox in info.ColIndexList)
                {
                    if (infox.HasChanged())
                    {
                        indexList.Add(infox);
                    }
                }
                foreach (SYS_UserGridColWidth infox in info.ColWidthList)
                {
                    if (infox.HasChanged())
                    {
                        widthList.Add(infox);
                    }
                }
                foreach (SYS_UserGridColName infox in info.ColNameList)
                {
                    if (infox.HasChanged())
                    {
                        nameList.Add(infox);
                    }
                }
                if (indexList.Count > 0 || widthList.Count > 0 || nameList.Count > 0)
                {
                    if (indexList.Count > 0)
                    {
                        info.ColIndexList = indexList;
                    }
                    if (widthList.Count > 0)
                    {
                        info.ColWidthList = widthList;
                    }

                    if (MySession.IsMainAccount && nameList.Count > 0)
                    {
                        info.ColNameList = nameList; //只有主帐号才保存自定义列名资料
                    }
                    saveList.Add(info);
                }
            }
            if (saveList.Count <= 0)
            {
                return(0);
            }

            ExeResult rst = WCFBLL.Execute("ZNLCRM.BLL.Sys.SYS_DataGridBLL", "SaveList", saveList);

            if (rst.Complete == ExeComplete.ErrorEx)
            {
                MessageBox.Show(rst.DebugMsg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (rst.Complete == ExeComplete.WarnEx)
            {
                MessageBox.Show(rst.Message, "警告提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            GridUserSetting.DataGridSetting = new List <SYS_DataGridResult>();
            return(ret);
        }