Esempio n. 1
0
        protected void btnSaveSPSendClientParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPSendClientParamsWrapper obj = SPSendClientParamsWrapper.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.MappingParams = this.cmbMappingParams.SelectedItem.Value.Trim();
                obj.Title         = this.txtTitle.Text.Trim();

                SPSendClientParamsWrapper.Update(obj);

                winSPSendClientParamsEdit.Hide();
            }
            catch
            (Exception
             ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void storeSPSendClientParams_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            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;
            }

            storeSPSendClientParams.DataSource = SPSendClientParamsWrapper.FindAllByOrderByAndClientID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, this.SPClientID, out recordCount);
            e.TotalCount = recordCount;

            storeSPSendClientParams.DataBind();
        }
Esempio n. 3
0
        protected void storeSPSendClientParams_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int clientID = 0;


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

            if (clientID == 0)
            {
                storeSPSendClientParams.DataSource = new List <SPSendClientParamsWrapper>();
                e.TotalCount = 0;
                return;
            }



            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;
            }

            storeSPSendClientParams.DataSource = SPSendClientParamsWrapper.FindAllByOrderByAndClientID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, clientID, out recordCount);
            e.TotalCount = recordCount;

            storeSPSendClientParams.DataBind();
        }
 public void FromWrapper(SPSendClientParamsWrapper wrapper)
 {
     this.Id            = wrapper.Id;
     this.Name          = wrapper.Name;
     this.Description   = wrapper.Description;
     this.IsEnable      = wrapper.IsEnable;
     this.IsRequired    = wrapper.IsRequired;
     this.ClientID      = (wrapper.ClientID != null) ? wrapper.ClientID.Id : 0;
     this.MappingParams = wrapper.MappingParams;
     this.Title         = wrapper.Title;
     this.ChannelID     = wrapper.ChannelID;
 }
Esempio n. 5
0
        public void DeleteRecord(int id)
        {
            try
            {
                SPSendClientParamsWrapper.DeleteByID(id);

                ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ScriptManager.AjaxSuccess      = false;
                ScriptManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
        public SPSendClientParamsWrapper ToWrapper()
        {
            SPSendClientParamsWrapper wrapper = new SPSendClientParamsWrapper();

            wrapper.Id            = this.Id;
            wrapper.Name          = this.Name;
            wrapper.Description   = this.Description;
            wrapper.IsEnable      = this.IsEnable;
            wrapper.IsRequired    = this.IsRequired;
            wrapper.ClientID      = (this.ClientID == null) ? null : SPClientWrapper.FindById(this.ClientID);
            wrapper.MappingParams = this.MappingParams;
            wrapper.Title         = this.Title;
            wrapper.ChannelID     = this.ChannelID;

            return(wrapper);
        }
        protected void btnSaveSPSendClientParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPSendClientParamsWrapper obj = new SPSendClientParamsWrapper();
                obj.Name          = this.txtName.Text.Trim();
                obj.Description   = this.txtDescription.Text.Trim();
                obj.IsEnable      = this.chkIsEnable.Checked;
                obj.IsRequired    = this.chkIsRequired.Checked;
                obj.ClientID      = SPClientWrapper.FindById(Convert.ToInt32(this.hidClientID.Text.Trim()));
                obj.MappingParams = this.cmbMappingParams.SelectedItem.Value.Trim();
                obj.Title         = this.txtTitle.Text.Trim();
                SPSendClientParamsWrapper.Save(obj);

                winSPSendClientParamsAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Esempio n. 8
0
        protected void btnSaveSPSendClientParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPSendClientParamsWrapper obj = new SPSendClientParamsWrapper();
                obj.Name = this.txtName.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.IsEnable = this.chkIsEnable.Checked;
                obj.IsRequired = this.chkIsRequired.Checked;
                obj.ClientID = SPClientWrapper.FindById(Convert.ToInt32(this.hidClientID.Text.Trim()));
                obj.MappingParams = this.cmbMappingParams.SelectedItem.Value.Trim();
                obj.Title = this.txtTitle.Text.Trim();
                SPSendClientParamsWrapper.Save(obj);

                winSPSendClientParamsAdd.Hide();

            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Esempio n. 9
0
        public void Show(int id)
        {
            try
            {
                SPSendClientParamsWrapper obj = SPSendClientParamsWrapper.FindById(id);

                if (obj != null)
                {
                    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.lblClientName.Text    = obj.ClientID.Name.ToString();
                    this.cmbMappingParams.SetValue(obj.MappingParams.ToString());
                    this.txtTitle.Text = obj.Title;



                    hidId.Text = id.ToString();


                    winSPSendClientParamsEdit.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;
            }
        }