Example #1
0
        protected void btnSaveSystemPost_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemPostWrapper obj = new SystemPostWrapper();
                obj.Name              = this.txtName.Text.Trim();
                obj.Code              = this.txtCode.Text.Trim();
                obj.Description       = this.txtDescription.Text.Trim();
                obj.OrganizationID    = SystemOrganizationWrapper.FindById(Convert.ToInt32(this.hidOrgID.Text.Trim()));
                obj.CreateBy          = this.ParentPage.CurrentLoginUser.UserID;
                obj.CreateAt          = System.DateTime.Now;
                obj.LastModifyBy      = this.ParentPage.CurrentLoginUser.UserID;
                obj.LastModifyAt      = System.DateTime.Now;;
                obj.LastModifyComment = "创建用户";



                SystemPostWrapper.Save(obj);

                winSystemPostAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #2
0
        protected void btnSaveSystemOrganization_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemOrganizationWrapper obj = SystemOrganizationWrapper.FindById(int.Parse(hidId.Text.Trim()));
                obj.Name               = this.txtName.Text.Trim();
                obj.ShortName          = this.txtShortName.Text.Trim();
                obj.Code               = this.txtCode.Text.Trim();
                obj.Description        = this.txtDescription.Text.Trim();
                obj.LogoUrl            = this.txtLogoUrl.Text.Trim();
                obj.Type               = this.txtType.Text.Trim();
                obj.MasterName         = this.txtMasterName.Text.Trim();
                obj.IsMainOrganization = this.chkIsMainOrganization.Checked;
                obj.TelPhone           = this.txtTelPhone.Text.Trim();
                obj.FaxNumber          = this.txtFaxNumber.Text.Trim();
                obj.WebSite            = this.txtWebSite.Text.Trim();
                obj.Email              = this.txtEmail.Text.Trim();



                SystemOrganizationWrapper.Update(obj, this.ParentPage.CurrentLoginUser.UserID, "更新组织信息");

                winSystemOrganizationEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
Example #3
0
        protected void btnSaveSystemDepartment_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemDepartmentWrapper obj = new SystemDepartmentWrapper();

                int pid = Convert.ToInt32(this.hidParentDepartmentID.Value);

                if (pid > 0)
                {
                    obj.ParentDepartmentID = SystemDepartmentWrapper.FindById(pid);
                }
                else
                {
                    obj.ParentDepartmentID = null;
                }

                obj.DepartmentNameCn     = this.txtDepartmentNameCn.Text.Trim();
                obj.DepartmentNameEn     = this.txtDepartmentNameEn.Text.Trim();
                obj.DepartmentDecription = this.txtDepartmentDecription.Text.Trim();
                obj.DepartmentSortIndex  = SystemDepartmentWrapper.GetNewMaxOrder(pid);
                obj.OrganizationID       = SystemOrganizationWrapper.FindById(OrginationID);
                SystemDepartmentWrapper.Save(obj);

                winSystemDepartmentAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), ex.Message);
            }
        }
Example #4
0
        public void DeleteData(int id)
        {
            try
            {
                SystemOrganizationWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception e)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = e.Message;
                return;
            }
        }
Example #5
0
        public void Show(int orgid)
        {
            try
            {
                //this.txtOrganizationID.Text = SystemOrganizationWrapper.FindById(orgid).Name;

                this.hidOrgID.Value         = orgid;
                this.txtOrganizationID.Text = SystemOrganizationWrapper.FindById(orgid).Name;
                this.winSystemPostAdd.Show();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #6
0
        protected void btnSaveSystemOrganization_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemOrganizationWrapper obj = new SystemOrganizationWrapper();


                int pid = Convert.ToInt32(this.hidParentOrgID.Value);

                if (pid > 0)
                {
                    obj.ParentID = SystemOrganizationWrapper.FindById(pid);
                }
                else
                {
                    obj.ParentID = null;
                }

                obj.Name        = this.txtName.Text.Trim();
                obj.ShortName   = this.txtShortName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.LogoUrl     = this.txtLogoUrl.Text.Trim();

                obj.MasterName         = this.txtMasterName.Text.Trim();
                obj.IsMainOrganization = this.chkIsMainOrganization.Checked;



                obj.TelPhone  = this.txtTelPhone.Text.Trim();
                obj.FaxNumber = this.txtFaxNumber.Text.Trim();
                obj.WebSite   = this.txtWebSite.Text.Trim();
                obj.Email     = this.txtEmail.Text.Trim();

                SystemOrganizationWrapper.Save(obj, this.ParentPage.CurrentLoginUser.UserID);

                winSystemOrganizationAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #7
0
        protected void btnSaveSystemOrganization_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemOrganizationWrapper obj = new SystemOrganizationWrapper();

                int pid = Convert.ToInt32(this.hidParentOrgID.Value);

                if (pid > 0)
                {
                    obj.ParentID = SystemOrganizationWrapper.FindById(pid);
                }
                else
                {
                    obj.ParentID = null;
                }

                obj.Name = this.txtName.Text.Trim();
                obj.ShortName = this.txtShortName.Text.Trim();
                obj.Code = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.LogoUrl = this.txtLogoUrl.Text.Trim();

                obj.MasterName = this.txtMasterName.Text.Trim();
                obj.IsMainOrganization = this.chkIsMainOrganization.Checked;

                obj.TelPhone = this.txtTelPhone.Text.Trim();
                obj.FaxNumber = this.txtFaxNumber.Text.Trim();
                obj.WebSite = this.txtWebSite.Text.Trim();
                obj.Email = this.txtEmail.Text.Trim();

                SystemOrganizationWrapper.Save(obj, this.ParentPage.CurrentLoginUser.UserID);

                winSystemOrganizationAdd.Hide();

            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #8
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();
        }
Example #9
0
        public void Show(int pID)
        {
            try
            {
                if (pID == 0)
                {
                    this.lblParentOrgName.Text = "As root org";
                }
                else
                {
                    this.lblParentOrgName.Text =
                        SystemOrganizationWrapper.FindById(pID).Name;
                }

                this.hidParentOrgID.Value = pID;
                this.winSystemOrganizationAdd.Show();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #10
0
        public void Show(int id)
        {
            try
            {
                SystemOrganizationWrapper obj = SystemOrganizationWrapper.FindById(id);

                if (obj != null)
                {
                    if (obj.ParentID == null)
                    {
                        this.lblParentOrgName.Text = "As root org";
                    }
                    else
                    {
                        this.lblParentOrgName.Text =
                            obj.ParentID.Name;
                    }



                    this.txtName.Text                  = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtShortName.Text             = ValueConvertUtil.ConvertStringValue(obj.ShortName);
                    this.txtCode.Text                  = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.txtDescription.Text           = ValueConvertUtil.ConvertStringValue(obj.Description);
                    this.txtLogoUrl.Text               = ValueConvertUtil.ConvertStringValue(obj.LogoUrl);
                    this.txtType.Text                  = ValueConvertUtil.ConvertStringValue(obj.Type);
                    this.txtMasterName.Text            = ValueConvertUtil.ConvertStringValue(obj.MasterName);
                    this.chkIsMainOrganization.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsMainOrganization);
                    if (obj.ParentID != null)
                    {
                        this.txtParentID.Text = obj.ParentID.Name;
                    }
                    else
                    {
                        this.txtParentID.Text = "As Root Org";
                    }
                    this.txtTelPhone.Text  = ValueConvertUtil.ConvertStringValue(obj.TelPhone);
                    this.txtFaxNumber.Text = ValueConvertUtil.ConvertStringValue(obj.FaxNumber);
                    this.txtWebSite.Text   = ValueConvertUtil.ConvertStringValue(obj.WebSite);
                    this.txtEmail.Text     = ValueConvertUtil.ConvertStringValue(obj.Email);



                    hidId.Text = id.ToString();


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