private TreeNodeCollection BuildTree(List <NavMenu> menus, string rootName)
        {
            TreeNodeCollection nodes = new TreeNodeCollection();

            TreeNode root = new TreeNode();

            root.Text = rootName;
            root.Icon = Icon.Folder;

            nodes.Add(root);

            if (menus == null || menus.Count == 0)
            {
                return(nodes);
            }

            foreach (var menu in menus)
            {
                TreeNode mainNode = new TreeNode();
                mainNode.Text   = menu.Name;
                mainNode.NodeID = menu.Id;
                WebUIHelper.SetIcon(menu.Icon, menu.IsCategory, mainNode);
                mainNode.CustomAttributes.Add(new ConfigItem("IsGroup", "1", ParameterMode.Value));
                mainNode.CustomAttributes.Add(new ConfigItem("MenuID", menu.Id, ParameterMode.Value));
                GenerateSubTreeNode(mainNode, menu);
                root.Nodes.Add(mainNode);
            }

            return(nodes);
        }
Esempio n. 2
0
        protected void storeSystemLog_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            List <QueryFilter> filters = new List <QueryFilter>();

            filters.Add(new QueryFilter(SystemLogWrapper.PROPERTY_NAME_LOGTYPE, LogType, FilterFunction.EqualTo));
            filters.Add(new QueryFilter(SystemLogWrapper.PROPERTY_NAME_PARENTDATAID, ParentID, FilterFunction.EqualTo));

            if (!string.IsNullOrEmpty(ParentType))
            {
                filters.Add(new QueryFilter(SystemLogWrapper.PROPERTY_NAME_PARENTDATATYPE, ParentType, FilterFunction.EqualTo));
            }


            if (dfStart.SelectedValue != null)
            {
                filters.Add(new QueryFilter(SystemLogWrapper.PROPERTY_NAME_LOGDATE, Convert.ToDateTime(dfStart.SelectedDate).ToString("yyyy-MM-dd"), FilterFunction.GreaterThanOrEqualTo));
            }
            if (dfEnd.SelectedValue != null)
            {
                filters.Add(new QueryFilter(SystemLogWrapper.PROPERTY_NAME_LOGDATE, Convert.ToDateTime(dfEnd.SelectedDate).AddDays(1).ToString("yyyy-MM-dd"), FilterFunction.LessThanOrEqualTo));
            }

            storeSystemLog.DataSource = SystemLogWrapper.FindAllByOrderByAndFilter(filters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemLog.DataBind();
        }
        protected void btnSaveSPCode_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPCodeWrapper obj = new SPCodeWrapper();


                obj.Description = this.txtDescription.Text.Trim();
                obj.ChannelID   = ChannelID;

                obj.IsMatchCase = chkIsMatchCase.Checked;


                if (!chkIsMatchCase.Checked)
                {
                    obj.Mo = this.txtMO.Text.Trim();
                }
                else
                {
                    obj.Mo = this.txtMO.Text;
                }


                obj.MOType       = this.cmbCodeType.SelectedItem.Value;
                obj.MOLength     = obj.Mo.Length;
                obj.MOType       = this.cmbCodeType.SelectedItem.Value;
                obj.OrderIndex   = 1;
                obj.SPCode       = this.txtSPCode.Text.Trim();
                obj.SPCodeType   = "1";
                obj.SPCodeLength = obj.SPCode.Length;
                obj.IsDiable     = this.chkIsDiable.Checked;

                obj.LimitProvince     = this.chkLimitProvince.Checked;
                obj.LimitProvinceArea = WebUIHelper.GetSelectMutilItems(this.mfLimitProvinceArea, ",");

                obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked;

                obj.HasFilters       = this.chkHasFilters.Checked;
                obj.HasParamsConvert = this.chkHasParamsConvert.Checked;
                obj.HasPhoneLimit    = this.chkHasPhoneLimit.Checked;

                obj.Price = Convert.ToDecimal(this.nfPrice.Text.Trim());

                obj.Description = this.txtDescription.Text.Trim();

                //obj.SendText = this.txtCodeSendText.Text.Trim();

                obj.Name = ChannelID.Name + "-" + obj.MoCode;
                obj.Code = ChannelID.Name + "-" + obj.MoCode;

                SPCodeWrapper.QuickAddCode(obj, this.txtSubCodes.Text);

                winSPCodeAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Esempio n. 4
0
        protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            if (sortFieldName == "ChannelTypeName")
            {
                sortFieldName = "ChannelType";
            }

            bool isDesc = (e.Dir == Ext.Net.SortDirection.DESC);

            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1.PageSize);

            if (string.IsNullOrEmpty(sortFieldName))
            {
                sortFieldName = "Id";
                isDesc        = true;
            }

            storeSPChannel.DataSource = SPChannelWrapper.FindAllByOrderBy(sortFieldName, isDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPChannel.DataBind();
        }
Esempio n. 5
0
        public ComponentVersion WebUILatestUnstableVersion()
        {
            ComponentVersion version = new ComponentVersion();

            version.version = WebUIHelper.WebUIGetLatestVersion(false);

            return(version);
        }
Esempio n. 6
0
        public ComponentVersion WebUILatestStableVersion()
        {
            ComponentVersion version = new ComponentVersion {
                version = WebUIHelper.WebUIGetLatestVersion(true)
            };

            return(version);
        }
Esempio n. 7
0
 protected override void OnPreRender(EventArgs e)
 {
     WebUIHelper.EmitClientScripts(Page);
     if (!String.IsNullOrEmpty(ProviderName))
     {
         ddlProviders.SelectedValue = ProviderName;
     }
     base.OnPreRender(e);
 }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);
            RecordSortor    recordSortor    = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(this.ChannelID, this.CodeID, this.ClientID, this.DataType, this.StartDate.Value, this.EndDate.Value, new List <QueryFilter>(), recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }
Esempio n. 9
0
        private void InitLeftMenu()
        {
            List <NavMenu> navMenus = SystemMenuWrapper.GetUserAssignedNavMenuByUserLoginID(CurrentLoginUser.UserLoginID);

            foreach (NavMenu m in navMenus)
            {
                TreeNode topnode = WebUIHelper.CreateMainItem(m, LeftPanel);

                WebUIHelper.CreateSubItem(m, topnode, this);
            }
        }
        protected void storeSystemApplication_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, 10);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeSystemApplication.DataSource = SystemApplicationWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemApplication.DataBind();
        }
        private void InitLeftMenu()
        {
            List <NavMenu> navMenus = SystemMenuWrapper.GetUserAssignedNavMenuByUserLoginID(CurrentTokenInfo.LoginUserID, SSOConfig.CurrentApplicationCode);

            foreach (NavMenu m in navMenus)
            {
                TreeNode topnode = WebUIHelper.CreateMainItem(m, LeftPanel);

                WebUIHelper.CreateSubItem(m, topnode, this);
            }
        }
        protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeSPCode.DataSource = SPCodeWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPCode.DataBind();
        }
        //protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        //{
        //    this.storeSPChannel.DataSource = SPChannelWrapper.FindAll();

        //    this.storeSPChannel.DataBind();
        //}


        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e,
                                                                                                         this.
                                                                                                         PagingToolBar1);

            ReportSearchCondition reportSearchCondition = GetReportSearchCondition(WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e));

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(reportSearchCondition.Channel, reportSearchCondition.Code, reportSearchCondition.Client, SPRecordWrapper.DayReportType_AllUp, reportSearchCondition.StartDate, reportSearchCondition.EndDate, reportSearchCondition.QueryFilters, reportSearchCondition.RecordSortor.OrderByColumnName, reportSearchCondition.RecordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }
        protected void storeSPAdPack_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);


            storeSPAdPack.DataSource = SPAdPackWrapper.FindAllByOrderByAndFilterAndSPAdID(recordSortor.OrderByColumnName, recordSortor.IsDesc, AdvertisementID, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPAdPack.DataBind();
        }
 private void GenerateSubTreeNode(TreeNode mainNode, NavMenu menu)
 {
     foreach (var sMenu in menu.SubMenus)
     {
         TreeNode subNode = new TreeNode();
         subNode.Text   = sMenu.Name;
         subNode.NodeID = sMenu.Id;
         WebUIHelper.SetIcon(menu.Icon, menu.IsCategory, mainNode);
         subNode.CustomAttributes.Add(new ConfigItem("IsGroup", (sMenu.IsCategory ? "1" : "0"), ParameterMode.Value));
         subNode.CustomAttributes.Add(new ConfigItem("MenuID", menu.Id, ParameterMode.Value));
         GenerateSubTreeNode(subNode, sMenu);
         mainNode.Nodes.Add(subNode);
     }
 }
Esempio n. 16
0
        private TreeNodeCollection BuildTree(List <NavMenu> menus, string rootName)
        {
            TreeNodeCollection nodes = new TreeNodeCollection();

            TreeNode root = new TreeNode();

            root.Text = rootName;
            root.Icon = Icon.Folder;

            nodes.Add(root);

            if (menus == null || menus.Count == 0)
            {
                return(nodes);
            }

            List <string> roleAssignedmenuIDs = SystemMenuWrapper.GetRoleAssignedMenuIDs(SystemRoleWrapper.FindById(RoleID));

            foreach (var menu in menus)
            {
                TreeNode mainNode = new TreeNode();
                mainNode.Text   = menu.Name;
                mainNode.NodeID = menu.Id;
                WebUIHelper.SetIcon(menu.Icon, menu.IsCategory, mainNode);
                mainNode.CustomAttributes.Add(new ConfigItem("IsGroup", "1", ParameterMode.Value));
                mainNode.CustomAttributes.Add(new ConfigItem("MenuID", menu.Id, ParameterMode.Value));

                if (roleAssignedmenuIDs.Contains(menu.Id.ToString()))
                {
                    mainNode.Checked = ThreeStateBool.True;
                }
                else
                {
                    mainNode.Checked = ThreeStateBool.False;
                }
                GenerateSubTreeNode(mainNode, menu, roleAssignedmenuIDs);
                root.Nodes.Add(mainNode);
            }



            //foreach (TreeNodeBase treeNodeBase in nodes)
            //{
            //    treeNodeBase.Checked = ThreeStateBool.False;
            //}



            return(nodes);
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (X.IsAjaxRequest)
            {
                return;
            }

            SPCodeWrapper obj = SPCodeWrapper.FindById(Convert.ToInt32(this.Request.QueryString["CodeID"]));

            if (obj != null)
            {
                this.hidSPCodeID.Text    = obj.Id.ToString();
                this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);

                this.chkIsMatchCase.Checked = obj.IsMatchCase.HasValue && obj.IsMatchCase.Value;

                this.txtMO.Text = ValueConvertUtil.ConvertStringValue(obj.Mo);

                this.lblCodeType.Text = obj.MoCode;

                this.txtSPCode.Text = ValueConvertUtil.ConvertStringValue(obj.SPCode);

                this.chkIsDiable.Checked = obj.IsDiable;

                this.chkLimitProvince.Checked = obj.LimitProvince.HasValue && obj.LimitProvince.Value;


                if (obj.LimitProvince.HasValue && obj.LimitProvince.Value)
                {
                    if (!string.IsNullOrEmpty(obj.LimitProvinceArea))
                    {
                        WebUIHelper.SetSelectMutilItems(this.mfLimitProvinceArea, ",", obj.LimitProvinceArea);
                    }
                }

                this.chkHasPhoneLimit.Checked    = obj.HasPhoneLimit;
                this.chkHasFilters.Checked       = obj.HasFilters;
                this.chkHasParamsConvert.Checked = obj.HasParamsConvert;

                if (obj.Price.HasValue)
                {
                    this.nfPrice.Value = obj.Price;
                }
                else
                {
                    this.nfPrice.Value = 0;
                }
            }
        }
Esempio n. 18
0
        public ActionResult InstallWebUI()
        {
            var indexLocation = Path.Combine(ServerSettings.ApplicationPath, "webui", "index.html");

            if (System.IO.File.Exists(indexLocation))
            {
                var index = System.IO.File.ReadAllText(indexLocation);
                var token = "\"Baka, baka, baka!! They found out I was peeking! Now my research is ruined!\" - Jiraiya";
                if (!index.Contains(token))
                {
                    return(Unauthorized("If trying to update, use api/webui/update"));
                }
            }
            WebUIHelper.GetUrlAndUpdate(WebUILatestStableVersion().version, "stable");
            return(Redirect("/webui/index.html"));
        }
Esempio n. 19
0
        protected void storeSystemUser_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            List <QueryFilter> queryFilters = new List <QueryFilter>();

            queryFilters.Add(new QueryFilter(SystemUserWrapper.PROPERTY_NAME_USERLOGINID, SystemUserWrapper.DEV_USER_ID, FilterFunction.NotEqualTo));

            if (!string.IsNullOrEmpty(this.txtSearchName.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SystemUserWrapper.PROPERTY_NAME_USERLOGINID, this.txtSearchName.Text.Trim(), FilterFunction.Contains));
            }

            storeSystemUser.DataSource = SystemUserWrapper.FindAllByOrderByAndFilter(queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemUser.DataBind();
        }
Esempio n. 20
0
        protected void storeSPSClient_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            if (string.IsNullOrEmpty(sortFieldName))
            {
                sortFieldName = SPSClientWrapper.PROPERTY_NAME_ID;
            }


            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            storeSPSClient.DataSource = SPSClientWrapper.FindAllByOrderBy(sortFieldName, (e.Dir == Ext.Net.SortDirection.DESC), pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPSClient.DataBind();
        }
Esempio n. 21
0
        protected void storeSystemPost_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);


            int selectOrgID = 0;

            if (!string.IsNullOrEmpty(e.Parameters["SelectOrgID"]))
            {
                selectOrgID = Convert.ToInt32(e.Parameters["SelectOrgID"]);
            }

            if (selectOrgID == 0)
            {
                storeSystemPost.DataSource = new List <SystemPostWrapper>();
                e.Total = 0;
                storeSystemPost.DataBind();

                return;
            }

            SystemOrganizationWrapper organization = SystemOrganizationWrapper.FindById(selectOrgID);

            if (organization == null)
            {
                storeSystemPost.DataSource = new List <SystemPostWrapper>();
                e.Total = 0;
                storeSystemPost.DataBind();

                return;
            }

            storeSystemPost.DataSource = SystemPostWrapper.FindAllByOrderByAndFilterAndOrganizationID(recordSortor.OrderByColumnName, recordSortor.IsDesc, organization, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemPost.DataBind();
        }
        protected void storeSystemDictionary_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            List <SystemDictionaryWrapper> datas = null;

            if (DictionaryGroup != null)
            {
                datas = SystemDictionaryWrapper.FindAllByOrderByAndFilterAndSystemDictionaryGroupID(recordSortor.OrderByColumnName, recordSortor.IsDesc, DictionaryGroup, pageQueryParams);
            }
            else
            {
                datas = SystemDictionaryWrapper.FindAllByOrderByAndFilter(new List <QueryFilter>(), recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            }

            storeSystemDictionary.DataSource = datas;
            e.Total = pageQueryParams.RecordCount;

            storeSystemDictionary.DataBind();
        }
Esempio n. 23
0
        protected void storeSystemPrivilege_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            int selectResourceID = 0;

            if (e.Parameters["SelectResourceID"] != null)
            {
                selectResourceID = Convert.ToInt32(e.Parameters["SelectResourceID"]);
            }

            if (selectResourceID == 0)
            {
                storeSystemPrivilege.DataSource = new List <SystemPrivilegeWrapper>();
                e.Total = 0;
                storeSystemPrivilege.DataBind();

                return;
            }

            SystemResourcesWrapper resourcesWrapper = SystemResourcesWrapper.FindById(selectResourceID);

            if (resourcesWrapper == null)
            {
                storeSystemPrivilege.DataSource = new List <SystemPrivilegeWrapper>();
                e.Total = 0;
                storeSystemPrivilege.DataBind();

                return;
            }

            storeSystemPrivilege.DataSource = SystemPrivilegeWrapper.FindAllByOrderByAndFilterAndResourcesID(recordSortor.OrderByColumnName, recordSortor.IsDesc, resourcesWrapper, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemPrivilege.DataBind();
        }
Esempio n. 24
0
 private void GenerateSubTreeNode(TreeNode mainNode, NavMenu menu, List <string> roleAssignedmenuIDs)
 {
     foreach (var sMenu in menu.SubMenus)
     {
         TreeNode subNode = new TreeNode();
         subNode.Text   = sMenu.Name;
         subNode.NodeID = sMenu.Id;
         WebUIHelper.SetIcon(menu.Icon, menu.IsCategory, mainNode);
         subNode.CustomAttributes.Add(new ConfigItem("IsGroup", (sMenu.IsCategory ? "1" : "0"), ParameterMode.Value));
         subNode.CustomAttributes.Add(new ConfigItem("MenuID", sMenu.Id, ParameterMode.Value));
         if (roleAssignedmenuIDs.Contains(menu.Id.ToString()))
         {
             subNode.Checked = ThreeStateBool.True;
         }
         else
         {
             subNode.Checked = ThreeStateBool.False;
         }
         //subNode.Leaf = sMenu.IsCategory;
         //mainNode.Leaf = sMenu.IsCategory;
         GenerateSubTreeNode(subNode, sMenu, roleAssignedmenuIDs);
         mainNode.Nodes.Add(subNode);
     }
 }
Esempio n. 25
0
        public string GetTreeNodes()
        {
            List <TypedTreeNodeItem <SystemOrganizationWrapper> > nodes = (new SystemOrganizationWrapper()).GetAllTreeItems();

            return(WebUIHelper.BuildTree <SystemOrganizationWrapper>(nodes, "All Organizations", Icon.Bricks).ToJson());
        }
        public string GetTreeNodes()
        {
            List <TypedTreeNodeItem <SystemResourcesWrapper> > nodes = new SystemResourcesWrapper().GetAllTreeItems();

            return(WebUIHelper.BuildTree <SystemResourcesWrapper>(nodes, "All Resources", Icon.Bricks).ToJson());
        }
Esempio n. 27
0
 protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
 {
     base.OnActivityResult(requestCode, resultCode, data);
     WebUIHelper.SetResult(requestCode, resultCode, data);
 }
Esempio n. 28
0
 protected override void OnPreRender(EventArgs e)
 {
     WebUIHelper.EmitClientScripts(this);
     base.OnPreRender(e);
 }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            //storeData.DataSource = new List<SPRecordWrapper>();
            //storeData.DataBind();

            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e,
                                                                                                         this.
                                                                                                         PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            SPChannelWrapper channel = null;



            SPSClientWrapper client = this.Client;



            SPCodeWrapper code = null;

            if (this.cmbCode.SelectedItem != null)
            {
                code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value));
            }

            DateTime?startDate = null;

            if (this.dfStart.SelectedValue != null)
            {
                startDate = this.dfStart.SelectedDate;
            }

            DateTime?endDate = null;

            if (this.dfEnd.SelectedValue != null)
            {
                endDate = this.dfEnd.SelectedDate;
            }

            List <QueryFilter> queryFilters = new List <QueryFilter>();

            if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE, this.txtPhoneNumber.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID, this.txtLinkID.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER, this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtMo.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(), FilterFunction.StartsWith));
            }


            queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT, (false).ToString(), FilterFunction.EqualTo));


            queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK, (true).ToString(), FilterFunction.EqualTo));


            //if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null)
            //{
            //    queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSYCNSUCCESSED, (this.cmbSycnStatus.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo));
            //}

            if (this.cmbProvince.SelectedItem != null && this.cmbProvince.SelectedItem.Value != null)
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_PROVINCE, this.cmbProvince.SelectedItem.Value.ToString(), FilterFunction.EqualTo));
            }

            if (this.cmbOperateType.SelectedItem != null && this.cmbOperateType.SelectedItem.Value != null)
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbOperateType.SelectedItem.Value.ToString(), FilterFunction.EqualTo));
            }

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(channel, code, client, SPRecordWrapper.DayReportType_AllUp, startDate, endDate, queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }
Esempio n. 30
0
        protected void btnSaveSPCode_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPCodeWrapper obj = SPCodeWrapper.FindById(int.Parse(hidSPCodeID.Text.Trim()));

                obj.Description = this.txtDescription.Text.Trim();

                obj.IsMatchCase = chkIsMatchCase.Checked;

                if (!chkIsMatchCase.Checked)
                {
                    obj.Mo = this.txtMO.Text.Trim();
                }
                else
                {
                    obj.Mo = this.txtMO.Text;
                }
                obj.MOLength = obj.Mo.Length;

                obj.SPCode       = this.txtSPCode.Text.Trim();
                obj.SPCodeLength = obj.SPCode.Length;

                obj.IsDiable = this.chkIsDiable.Checked;

                obj.LimitProvince = this.chkLimitProvince.Checked;

                string oldLimitProvinceArea = obj.LimitProvinceArea;

                obj.LimitProvinceArea = WebUIHelper.GetSelectMutilItems(this.mfLimitProvinceArea, ",");


                if (obj.LimitProvinceArea != oldLimitProvinceArea)
                {
                    List <PhoneLimitAreaAssigned> phoneLimitAreas = new List <PhoneLimitAreaAssigned>();

                    string[] provinces = obj.LimitProvinceArea.Split((",").ToCharArray());

                    foreach (string province in provinces)
                    {
                        phoneLimitAreas.Add(new PhoneLimitAreaAssigned()
                        {
                            AreaName = province, LimitCount = 0
                        });
                    }

                    obj.DayTotalLimitInProvinceAssignedCount = SerializeUtil.ToJson(phoneLimitAreas);
                }

                obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked;

                obj.HasFilters       = this.chkHasFilters.Checked;
                obj.HasParamsConvert = this.chkHasParamsConvert.Checked;
                obj.HasPhoneLimit    = this.chkHasPhoneLimit.Checked;

                obj.Price = Convert.ToDecimal(this.nfPrice.Text.Trim());

                SPCodeWrapper.Update(obj);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }