protected void btnSaveSPChannelParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPChannelParamsWrapper obj = new SPChannelParamsWrapper();

                obj.Name              = this.txtName.Text.Trim();
                obj.Description       = this.txtDescription.Text.Trim();
                obj.IsEnable          = this.chkIsEnable.Checked;
                obj.IsRequired        = this.chkIsRequired.Checked;
                obj.ParamsType        = this.cmbParamsType.SelectedItem.Value.Trim();
                obj.ChannelID         = SPChannelWrapper.FindById(Convert.ToInt32(this.hidChannelID.Text.Trim()));
                obj.ParamsMappingName = this.cmbParamsMappingName.SelectedItem.Text.Trim();
                obj.Title             = this.txtTitle.Text.Trim();
                obj.ShowInClientGrid  = this.chkShowInClientGrid.Checked;
                SPChannelParamsWrapper.Save(obj);

                winSPChannelParamsAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Пример #2
0
        protected void btnSaveSPChannelParams_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPChannelParamsWrapper obj = SPChannelParamsWrapper.FindById(int.Parse(hidId.Text.Trim()));
                obj.Name        = this.txtName.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.IsEnable    = this.chkIsEnable.Checked;
                obj.IsRequired  = this.chkIsRequired.Checked;
                obj.ParamsType  = this.cmbChannelParamsType.SelectedItem.Value.Trim();

                obj.ParamsMappingName = this.cmbParamsMappingName.SelectedItem.Value.Trim();
                obj.Title             = this.txtTitle.Text.Trim();
                obj.ShowInClientGrid  = this.chkShowInClientGrid.Checked;
                obj.ParamsValue       = this.txtParamsValue.Text.Trim();


                SPChannelParamsWrapper.Update(obj);

                winSPChannelParamsEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
 public void FromWrapper(SPChannelParamsWrapper wrapper)
 {
     this.Id                = wrapper.Id;
     this.Name              = wrapper.Name;
     this.Description       = wrapper.Description;
     this.IsEnable          = wrapper.IsEnable;
     this.IsRequired        = wrapper.IsRequired;
     this.ParamsType        = wrapper.ParamsType;
     this.ChannelID         = (wrapper.ChannelID != null) ? wrapper.ChannelID.Id : 0;
     this.ParamsMappingName = wrapper.ParamsMappingName;
     this.Title             = wrapper.Title;
     this.ShowInClientGrid  = wrapper.ShowInClientGrid;
     this.IsUnique          = wrapper.IsUnique;
 }
Пример #4
0
        protected void storeSPChannelParams_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int channelID = 0;


            if (!string.IsNullOrEmpty(e.Parameters["channelID"]))
            {
                try
                {
                    channelID = int.Parse(e.Parameters["channelID"]);
                }
                catch
                {
                }
            }


            int    recordCount   = 0;
            string sortFieldName = "";

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

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            storeSPChannelParams.DataSource = SPChannelParamsWrapper.FindAllByOrderBy(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, channelID, out recordCount);
            e.TotalCount = recordCount;

            storeSPChannelParams.DataBind();
        }
Пример #5
0
        public void DeleteRecord(int id)
        {
            try
            {
                SPChannelParamsWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Пример #6
0
        public string this[string paramKey]
        {
            get
            {
                SPChannelParamsWrapper spcpw =
                    cpparams.Find(p => (p.ParamsMappingName.Equals(paramKey)));

                if (spcpw != null)
                {
                    return(spcpw.Name.ToLower());
                }

                return(DictionaryConst.Dictionary_SPField_State_Key.ToLower());
            }
        }
        public SPChannelParamsWrapper ToWrapper()
        {
            SPChannelParamsWrapper wrapper = new SPChannelParamsWrapper();

            wrapper.Id                = this.Id;
            wrapper.Name              = this.Name;
            wrapper.Description       = this.Description;
            wrapper.IsEnable          = this.IsEnable;
            wrapper.IsRequired        = this.IsRequired;
            wrapper.ParamsType        = this.ParamsType;
            wrapper.ChannelID         = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ParamsMappingName = this.ParamsMappingName;
            wrapper.Title             = this.Title;
            wrapper.ShowInClientGrid  = this.ShowInClientGrid;
            wrapper.IsUnique          = this.IsUnique;

            return(wrapper);
        }
Пример #8
0
        protected void storeSPChannelParams_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

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

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }


            PageQueryParams pageQueryParams = new PageQueryParams();

            pageQueryParams.PageSize  = limit;
            pageQueryParams.PageIndex = pageIndex;

            storeSPChannelParams.DataSource = SPChannelParamsWrapper.FindAllByOrderByAndFilterAndChannelID(sortFieldName, (e.Dir == Ext.Net.SortDirection.DESC), ChannelID, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPChannelParams.DataBind();
        }
Пример #9
0
        public void Show(int id)
        {
            try
            {
                SPChannelParamsWrapper obj = SPChannelParamsWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text          = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtDescription.Text   = ValueConvertUtil.ConvertStringValue(obj.Description);
                    this.chkIsEnable.Checked   = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsEnable);
                    this.chkIsRequired.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsRequired);

                    this.txtTitle.Text = ValueConvertUtil.ConvertStringValue(obj.Title);
                    this.chkShowInClientGrid.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.ShowInClientGrid);
                    this.txtParamsValue.Text         = ValueConvertUtil.ConvertStringValue(obj.ParamsValue);

                    this.cmbChannelParamsType.SetValue(obj.ParamsType);
                    this.cmbParamsMappingName.SetValue(obj.ParamsMappingName);


                    hidId.Text = id.ToString();


                    winSPChannelParamsEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
Пример #10
0
        public void Show(int id)
        {
            try
            {
                SPChannelParamsWrapper obj = SPChannelParamsWrapper.FindById(id);

                if (obj != null)
                {
                    this.hidId.Value           = obj.Id.ToString();
                    this.txtName.Text          = obj.Name.ToString();
                    this.txtDescription.Text   = obj.Description.ToString();
                    this.chkIsEnable.Checked   = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsEnable);
                    this.chkIsRequired.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsRequired);
                    this.cmbParamsType.SetValue(obj.ParamsType.ToString());
                    this.lblChannelName.Text = obj.ChannelID.Name.ToString();
                    this.cmbParamsMappingName.SetValue(obj.ParamsMappingName.ToString());
                    this.txtTitle.Text = obj.Title;
                    this.chkShowInClientGrid.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.ShowInClientGrid);


                    hidId.Text = id.ToString();


                    winSPChannelParamsEdit.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
Пример #11
0
        public SPChannelParamsWrapper ToWrapper()
        {
            SPChannelParamsWrapper wrapper = new SPChannelParamsWrapper();
            wrapper.Id = this.Id;
            wrapper.Name = this.Name;
            wrapper.Description = this.Description;
            wrapper.IsEnable = this.IsEnable;
            wrapper.IsRequired = this.IsRequired;
            wrapper.ParamsType = this.ParamsType;
            wrapper.ChannelID =  (this.ChannelID==null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ParamsMappingName = this.ParamsMappingName;
            wrapper.Title = this.Title;
            wrapper.ShowInClientGrid = this.ShowInClientGrid;
            wrapper.IsUnique = this.IsUnique;

            return wrapper;
        }
Пример #12
0
 public void FromWrapper(SPChannelParamsWrapper wrapper)
 {
     this.Id = wrapper.Id;
     this.Name = wrapper.Name;
     this.Description = wrapper.Description;
     this.IsEnable = wrapper.IsEnable;
     this.IsRequired = wrapper.IsRequired;
     this.ParamsType = wrapper.ParamsType;
     this.ChannelID = (wrapper.ChannelID!=null) ? wrapper.ChannelID.Id : 0 ;
     this.ParamsMappingName = wrapper.ParamsMappingName;
     this.Title = wrapper.Title;
     this.ShowInClientGrid = wrapper.ShowInClientGrid;
     this.IsUnique = wrapper.IsUnique;
 }