Пример #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DalOperationAboutSalaryItem dal = new DalOperationAboutSalaryItem();
               string pageIndex = this.hf_page.Value;
            if (this.btnSubmit.Text == "添加")
            {
                SalaryItem salaryItem = new SalaryItem();
                salaryItem.salaryItemName = salaryItemName.Text.Trim();
                salaryItem.salaryItemUnit = salaryItemUnit.Text.Trim();
                salaryItem.salaryItemDesc = salaryItemDesc.Text.Trim();
                if (SalaryItemIsHidden.Checked)
                {
                    salaryItem.salaryItemStatus = 2;        //默认隐藏
                }
                else {
                    salaryItem.salaryItemStatus = 1;        //默认展示
                }

                if (SalaryItemForOutTeacher.Checked)
                {
                    salaryItem.useFor = 2;                  //适用于院外教师
                }
                else if (SalaryItemForOutAssistant.Checked)
                {
                    salaryItem.useFor = 3;                  //适用于院外助教
                }
                else {
                    salaryItem.useFor = 1;                  //适用于院内教师/助教
                }

                salaryItem.hasTax = cb_hasTax.Checked;
                salaryItem.isDefaultChecked = cb_defaultChecked.Checked;

                dal.AddSalaryItem(salaryItem);

                Javascript.RefreshParentWindow("/Administrator/SalaryManage.aspx?fragment=2&page=" + pageIndex,  Page);
            }
            else if (this.btnSubmit.Text == "修改")
            {
                if (Request["salaryItemId"] != null)
                {
                    string salaryItemId = Request["salaryItemId"].ToString().Trim();

                    SalaryItem item = dal.GetSalaryItemById(int.Parse(salaryItemId));
                    item.salaryItemName = salaryItemName.Text;
                    item.salaryItemUnit = salaryItemUnit.Text;
                    item.salaryItemDesc = salaryItemDesc.Text;
                    item.hasTax = cb_hasTax.Checked;
                    item.isDefaultChecked = cb_defaultChecked.Checked;

                    dal.updateSalaryItem(item);

                    Javascript.RefreshParentWindow("/Administrator/SalaryManage.aspx?fragment=2&page=" + pageIndex, Page);
                }

            }
        }
Пример #2
0
 /// <summary>
 /// 根据薪酬项id字符串获得相应的薪酬项信息列表 
 /// </summary>
 /// <param name="salaryItemIds"></param>
 /// <returns></returns>
 private List<SalaryItem> GetOutSalaryItemListByIdString(string salaryItemIds)
 {
     string[] salaryItemIdArray = ConvertSalaryItemIdString2Array(salaryItemIds);
     List<SalaryItem> salaryItemList = new List<SalaryItem>();
     if (salaryItemIdArray != null)
     {
         DalOperationAboutSalaryItem dal = new DalOperationAboutSalaryItem();
         foreach (string salaryItemId in salaryItemIdArray)
         {
             salaryItemList.Add(dal.GetSalaryItemById(int.Parse(salaryItemId)));
         }
     }
     return salaryItemList;
 }
Пример #3
0
 /// <summary>
 /// 根据薪酬项id字符串获得相应的薪酬项信息列表 
 /// </summary>
 /// <param name="salaryItemIds"></param>
 /// <returns></returns>
 private List<SalaryItem> GetInSalaryItemListByIdString(string salaryItemIds, TeacherSalary teacherSalary)
 {
     string[] salaryItemIdArray = ConvertSalaryItemIdString2Array(salaryItemIds);
     List<SalaryItem> salaryItemList = new List<SalaryItem>();
     if (salaryItemIdArray != null)
     {
         DalOperationAboutSalaryItem dal = new DalOperationAboutSalaryItem();
         foreach (string salaryItemId in salaryItemIdArray)
         {
             SalaryItem salaryItem = dal.GetSalaryItemById(int.Parse(salaryItemId));
             SetSalaryItemElement(salaryItem, teacherSalary);
             salaryItemList.Add(salaryItem);
         }
     }
     return salaryItemList;
 }
 private void FullFillSalaryItemElements(List<SalaryItemElement> itemElements)
 {
     DalOperationAboutSalaryItem dal = new DalOperationAboutSalaryItem();
     if (itemElements != null && itemElements.Count > 0)
     {
         foreach (SalaryItemElement itemElement in itemElements)
         {
             SalaryItem item = dal.GetSalaryItemById(int.Parse(itemElement.salaryItemId));
             itemElement.salaryItemName = item.salaryItemName;
             itemElement.itemUnit = item.salaryItemUnit;
             itemElement.hasTax = item.hasTax;
         }
     }
 }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string pageIndex = Request["page"];

                if (pageIndex == null || pageIndex.Trim().Length == 0)
                {
                    pageIndex = "1";
                }
                else {
                    pageIndex = Request["page"].Trim();
                }

                string operation = Request["op"];
                if ("edit".Equals(operation))
                {
                    string itemID = Request["salaryItemId"];

                    if (itemID == null || itemID.Trim().Length == 0)
                    {
                        Javascript.Alert("请提供正确的薪酬项Id", Page);
                        Javascript.RefreshParentWindowReload(Page);
                    }
                    else
                    {
                        DalOperationAboutSalaryItem dal = new DalOperationAboutSalaryItem();
                        SalaryItem item = dal.GetSalaryItemById(int.Parse(Request["salaryItemId"].ToString().Trim()));
                        salaryItemName.Text = item.salaryItemName;
                        salaryItemUnit.Text = item.salaryItemUnit;
                        salaryItemDesc.Text = item.salaryItemDesc;
                        cb_hasTax.Checked = item.hasTax;
                        cb_defaultChecked.Checked = item.isDefaultChecked;

                        SalaryVisible_TR.Visible = false;
                        UserFor_TR.Visible = false;
                        this.btnSubmit.Text = "修改";
                    }
                }
                else
                {
                    this.btnSubmit.Text = "添加";
                    cb_hasTax.Checked = true;
                    this.UserFor_TR.Visible = true;
                }
                this.hf_page.Value = pageIndex;
            }
        }