protected void cb_Selected_CheckedChanged(object sender, EventArgs e) { //81,80,82 常规导购管理费(月付类)临时导购管理费(工服工卡等费用项)兼职导购工资次次月核销10日核销 //SuperID IN (176,73)陈列费 月付,季度付 次月10号才能核销 CheckBox t = (CheckBox)sender; GridViewRow drv = (GridViewRow)t.NamingContainer; int rowIndex = drv.RowIndex; int applydetailid = (int)gv_FeeAplyList.DataKeys[rowIndex]["FNA_FeeApplyDetail_ID"]; FNA_FeeApplyDetail applydetail = new FNA_FeeApplyBLL().GetDetailModel(applydetailid); CM_ContractDetail contractdetail = new CM_ContractBLL().GetDetailModel(applydetail.RelateContractDetail); try { if (applydetail.AccountTitle == 81 && applydetail.Remark.IndexOf("合同编号") >= 0) { return; } if (applydetail.AccountTitle >= 80 && applydetail.AccountTitle <= 82) { t.Checked = CheckLimitWriteOffDate(applydetail.BeginMonth + 2); } else if (AC_AccountTitleBLL.GetModelList("SuperID IN (176,73)").Where(p => p.ID == applydetail.AccountTitle).ToList().Count > 0 && contractdetail != null && contractdetail.PayMode != 12 && contractdetail.PayMode != 6 && contractdetail.BearMode == 1) { t.Checked = CheckLimitWriteOffDate(applydetail.BeginMonth + 1); } } catch (Exception) { throw; } }
private void BindDropDown() { DropDownList ddl_QNAProject = (DropDownList)pl_detail.FindControl("CAT_Activity_RelateQuestionnaire"); if (ddl_QNAProject != null) { ddl_QNAProject.DataSource = QNA_ProjectBLL.GetModelList("Classify = 3 AND Enabled='Y'"); ddl_QNAProject.DataTextField = "Name"; ddl_QNAProject.DataValueField = "ID"; ddl_QNAProject.DataBind(); ddl_QNAProject.Items.Insert(0, new ListItem("请选择...", "0")); } IList <AC_AccountTitle> lists; if (ConfigHelper.GetConfigInt("ActivityFeeAccountTitle2") == 0) { lists = AC_AccountTitleBLL.GetListByFeeType(ConfigHelper.GetConfigInt("HDM-CATFeeType")); } else { lists = AC_AccountTitleBLL.GetModelList("(ID = 1 OR SuperID=" + ConfigHelper.GetConfigString("ActivityFeeAccountTitle2") + ") AND MCS_SYS.dbo.UF_Spilt2('MCS_Pub.dbo.AC_AccountTitle',ExtPropertys,'IsDisable')<>'Y'"); } ddl_AccountTitle.DataSource = lists; ddl_AccountTitle.DataBind(); ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent=1"); ddl_Brand.DataBind(); ddl_Brand.Items.Insert(0, new ListItem("请选择...", "0")); }
protected void ddl_FeeType_SelectedIndexChanged(object sender, EventArgs e) { if (ddl_FeeType.SelectedValue != "0") { ddl_AccountTitle.DataSource = AC_AccountTitleBLL.GetListByFeeType(int.Parse(ddl_FeeType.SelectedValue)); ddl_AccountTitle.DataBind(); } ddl_AccountTitle.Items.Insert(0, new ListItem("请选择", "0")); ddl_AccountTitle.SelectedValue = "0"; }
protected void btn_Delete_Click(object sender, EventArgs e) { AC_AccountTitleBLL _bll = new AC_AccountTitleBLL(int.Parse(lbl_ID.Text)); if (_bll.Delete() < 0) { lbl_AlertInfo.Text = "该会计科目包含下级会计科目,请勿删除"; return; } lbl_AlertInfo.Text = ""; Response.Redirect("AccountTitle.aspx?SuperID=" + _bll.Model.SuperID.ToString()); }
private void BindGrid() { IList <FNA_FeeWriteOffDetail> list = ((IList <FNA_FeeWriteOffDetail>)ViewState["Details"]).OrderBy(p => p.Client).ThenBy(p => p.AccountTitle).ThenBy(p => p.BeginMonth).ToList(); IList <AC_AccountTitle> titleList = AC_AccountTitleBLL.GetModelList(ConfigHelper.GetConfigString("PagingType")); int pagecount = 0, cycle = 1; for (int i = 1; i < list.Count; i++) { if (list[i].Client == list[i - 1].Client || (titleList.Where(p => p.ID == list[i].AccountTitle).Count() == 0 && titleList.Where(p => p.ID == list[i - 1].AccountTitle).Count() == 0)) { if (++cycle == PRINTPAGESIZE) { ht_pageitem[pagecount.ToString()] = cycle; pagecount++; cycle = 0; } } else if (cycle > 0) { ht_pageitem[pagecount.ToString()] = cycle; pagecount++; cycle = 1; } else if (cycle == 0) { cycle = 1; } } if (cycle > 0) { ht_pageitem[pagecount.ToString()] = cycle; pagecount++; } int[] Pages = new int[pagecount]; //Pages = new int[list.Count / PRINTPAGESIZE + (list.Count % PRINTPAGESIZE == 0 ? 0 : 1)]; for (int i = 0; i < Pages.Length; i++) { Pages[i] = i; } ViewState["TotalPage"] = Pages.Length; Repeater1.DataSource = Pages; Repeater1.DataBind(); }
private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } #endregion int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays"); ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") + "' AND Year>=" + (DateTime.Today.Year - 1).ToString()); ddl_Month.DataBind(); ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString(); ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name); ddl_FeeType.DataBind(); ddl_FeeType.Items.Insert(0, new ListItem("全部", "0")); ddl_State.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeApplyState"); ddl_State.DataBind(); ddl_State.Items.Insert(0, new ListItem("全部", "0")); AC_AccountTitle title = new AC_AccountTitleBLL(int.Parse(ViewState["AccountTitle"].ToString())).Model; if (title != null) { DataTable dt = TreeTableBLL.GetAllChildNodeByNodes("MCS_Pub.dbo.AC_AccountTitle", "ID", "SuperID", title.ID.ToString()); DataRow dr = dt.NewRow(); dr["ID"] = title.ID; dr["SuperID"] = 1; dr["Name"] = title.Name; dt.Rows.Add(dr); tr_AccountTitle.DataSource = dt; tr_AccountTitle.SelectValue = title.ID.ToString(); tr_AccountTitle.RootValue = "1"; } }
private void BindDropDown() { #region 绑定物业租赁所需的费用科目 int ContractFeeType = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ContractFeeType-PD"]); int ContractAccountTitle = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ContractAccountTitle-PD"]); ddl_AccountTitle.DataSource = AC_AccountTitleBLL.GetListByFeeType(ContractFeeType).Where(p => p.SuperID == ContractAccountTitle || p.ID == ContractAccountTitle); ddl_AccountTitle.DataBind(); #endregion #region 绑定付款周期 ddl_PayMode.DataSource = DictionaryBLL.GetDicCollections("PUB_PayMode"); ddl_PayMode.DataBind(); ddl_PayMode.Items.Insert(0, new ListItem("所有", "0")); ddl_PayMode.SelectedValue = "1"; #endregion }
protected void ddl_FeeType_SelectedIndexChanged(object sender, EventArgs e) { if (ConfigHelper.GetConfigBool("FeeApplyByAccountTitleLevel2")) { if (ddl_FeeType.SelectedValue != "0") { ddl_AccountTitle2.DataSource = AC_AccountTitleBLL.GetListByFeeType(int.Parse(ddl_FeeType.SelectedValue)).Where(p => p.Level == 2); ddl_AccountTitle2.DataBind(); } else { ddl_AccountTitle2.Items.Clear(); } ddl_AccountTitle2.Items.Insert(0, new ListItem("请选择...", "0")); } }
private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } #endregion int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays"); ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") + "' AND Year>=" + (DateTime.Today.Year - 1).ToString()); ddl_AccountMonth.DataBind(); ddl_AccountMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString(); ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name).ToList(); ddl_FeeType.DataBind(); foreach (ListItem item in ddl_FeeType.Items) { if (AC_AccountTitleBLL.GetListByFeeType(int.Parse(item.Value)).Where(p => p.ID > 1).ToList().Count == 0) { item.Enabled = false; } } if (ConfigHelper.GetConfigBool("FeeApplyByAccountTitleLevel2")) { tr_AccountTitle2.Visible = true; ddl_FeeType.AutoPostBack = true; ddl_FeeType.Items.Insert(0, new ListItem("请选择...", "0")); ddl_FeeType_SelectedIndexChanged(null, null); } ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent='1'"); ddl_Brand.DataBind(); ddl_Brand.Items.Insert(0, new ListItem("多品牌", "0")); }
private void BindTree(TreeNodeCollection TNC, int SuperID) { AC_AccountTitleBLL _bll = new AC_AccountTitleBLL(); IList <AC_AccountTitle> _modellist = _bll._GetModelList("SuperID=" + SuperID.ToString()); foreach (AC_AccountTitle _model in _modellist) { TreeNode tn = new TreeNode(); tn.Text = _model.Name; tn.Value = _model.ID.ToString(); TNC.Add(tn); if (_model.ID == 1) { BindTree(tn.ChildNodes, _model.ID); } } }
private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } if ((int)ViewState["OrganizeCity"] > 0) { tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString(); } #endregion int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays"); ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") + "' AND Year>=" + (DateTime.Today.Year - 1).ToString()); ddl_Month.DataBind(); ddl_Month.SelectedValue = (int)ViewState["AccountMonth"] == 0 ? AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString() : ViewState["AccountMonth"].ToString(); ddl_RTChannel.DataSource = DictionaryBLL.GetDicCollections("CM_RT_Channel"); ddl_RTChannel.DataBind(); ddl_RTChannel.Items.Insert(0, new ListItem("所有", "0")); ddl_RTChannel.SelectedValue = "0"; ddl_RTType.DataSource = DictionaryBLL.GetDicCollections("CM_RT_Classify"); ddl_RTType.DataBind(); ddl_RTType.Items.Insert(0, new ListItem("所有", "0")); ddl_RTType.SelectedValue = "0"; IList <AC_AccountTitle> listsNKA = AC_AccountTitleBLL.GetModelList("SuperID IN (73,176) OR ID IN (73,176,33,34)"); IList <AC_AccountTitle> dest = new List <AC_AccountTitle>(listsNKA.Count); AC_AccountTitleBLL.SortAccountTitle(listsNKA, dest, 8); ddl_AccountTitle.DataSource = dest; ddl_AccountTitle.DataBind(); ddl_AccountTitle.Items.Insert(0, new ListItem("所有", "0")); ddl_AccountTitle.SelectedValue = "0"; }
protected IList <AC_AccountTitle> GetAccountTitleList() { IList <AC_AccountTitle> lists; if ((int)ViewState["AccountTitle2"] == 0) { lists = AC_AccountTitleBLL.GetListByFeeType((int)ViewState["FeeType"]); } else { lists = AC_AccountTitleBLL.GetModelList("(ID = 1 OR SuperID=" + ViewState["AccountTitle2"].ToString() + ") AND MCS_SYS.dbo.UF_Spilt2('MCS_Pub.dbo.AC_AccountTitle',ExtPropertys,'IsDisable')<>'Y'"); } if (ViewState["FromGeneralFlow"].ToString() == "Y") { lists = lists.Where(p => p["CanApplyInGeneralFlow"] != "N").ToList(); } return(lists); }
private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } tr_OrganizeCity_Selected(null, null); #endregion int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays"); ddl_ApplyMonth.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") + "' AND Year>=" + (DateTime.Today.Year - 1).ToString()); ddl_ApplyMonth.DataBind(); ddl_ApplyMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString(); rbl_GiftClassify.DataSource = DictionaryBLL.GetDicCollections("ORD_GiftClassify"); rbl_GiftClassify.DataBind(); rbl_GiftClassify.SelectedValue = "1"; ddl_AccountTitle.DataSource = AC_AccountTitleBLL.GetListByFeeType((int)ViewState["GiftFeeType"]); ddl_AccountTitle.DataBind(); ddl_LastWriteOffMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate>=GETDATE() AND BeginDate<DATEADD(month,5,GETDATE())"); ddl_LastWriteOffMonth.DataBind(); ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent='1'"); ddl_Brand.DataBind(); ddl_Brand.Items.Insert(0, new ListItem("请选择...", "0")); }
private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } #endregion rbl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name).ToList(); rbl_FeeType.DataBind(); foreach (ListItem item in rbl_FeeType.Items) { if (AC_AccountTitleBLL.GetListByFeeType(int.Parse(item.Value)).Where(p => p.ID > 1).ToList().Count == 0) { item.Enabled = false; } } rbl_FeeType.Items.Insert(0, new ListItem("请选择", "0")); ddl_InvoiceClassAB.DataSource = DictionaryBLL.GetDicCollections("FNA_InvoiceClassAB").OrderBy(p => p.Value.Name).ToList(); ddl_InvoiceClassAB.DataBind(); ddl_InvoiceClassAB.Items.Insert(0, new ListItem("请选择", "0")); //select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=2&OrganizeCity=" + tr_OrganizeCity.SelectValue + "&ExtCondition=\"MCS_SYS.dbo.UF_Spilt(CM_Client.ExtPropertys,~|~,7) IN (1,3)\""; //select_Staff.PageUrl = "~/SubModule/StaffManage/Pop_Search_Staff.aspx?OrganizeCity=" + tr_OrganizeCity.SelectValue; }
private void BindData(int ID) { ViewState["ID"] = ID; AC_AccountTitleBLL _bll = new AC_AccountTitleBLL(ID); lbl_ID.Text = _bll.Model.ID.ToString(); tbx_Name.Text = _bll.Model.Name; if (_bll.Model.SuperID != 0) { tree_SuperID.SelectValue = _bll.Model.SuperID.ToString(); } tbx_Code.Text = _bll.Model.Code; tbx_Description.Text = _bll.Model.Description; tbx_OverPercent.Text = _bll.Model["OverPercent"] == "" ? "0" : _bll.Model["OverPercent"]; cbx_MustApplyFirst.Checked = _bll.Model["MustApplyFirst"] != "N"; cbx_IsDisable.Checked = _bll.Model["IsDisable"] == "Y"; cbx_CanApplyInGeneralFlow.Checked = _bll.Model["CanApplyInGeneralFlow"] != "N"; txt_MonthsOverdue.Text = _bll.Model["MonthsOverdue"] == "" ? "1" : _bll.Model["MonthsOverdue"]; txt_YFMonthsOverdue.Text = _bll.Model["YFMonthsOverdue"] == "" ? "1" : _bll.Model["YFMonthsOverdue"]; if (_bll.Model.Level != 0) lbl_LevelName.Text = DictionaryBLL.GetDicCollections("AC_AccountTitleLevel")[_bll.Model.Level.ToString()].Name; if (_bll.Model.Level > 3) cbl_FeeType.Enabled = false; else cbl_FeeType.Enabled = true; cbl_FeeType.Items.Clear(); cbl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType"); cbl_FeeType.DataBind(); foreach (AC_AccountTitleInFeeType item in AC_AccountTitleInFeeTypeBLL.GetModelList("AccountTitle=" + ID.ToString())) { cbl_FeeType.Items.FindByValue(item.FeeType.ToString()).Selected = true; } btn_Save.Text = "修改"; btn_Save.ForeColor = System.Drawing.Color.Red; btn_Delete.Visible = true; MessageBox.ShowConfirm(btn_Delete, "数据删除将不可恢复,确定删除么?"); btn_Cancel.Visible = true; bt_AddSub.Visible = true; lbl_AlertInfo.Text = ""; if ((int)ViewState["ID"] == 1) { btn_Save.Enabled = false; } else { btn_Save.Enabled = true; } btn_Delete.Visible = AC_AccountTitleBLL.GetModelList("SuperID=" + ViewState["ID"].ToString()).Count == 0; }
private void BindData(int ID) { ViewState["ID"] = ID; AC_AccountTitleBLL _bll = new AC_AccountTitleBLL(ID); lbl_ID.Text = _bll.Model.ID.ToString(); tbx_Name.Text = _bll.Model.Name; if (_bll.Model.SuperID != 0) { tree_SuperID.SelectValue = _bll.Model.SuperID.ToString(); } tbx_Code.Text = _bll.Model.Code; tbx_Description.Text = _bll.Model.Description; tbx_OverPercent.Text = _bll.Model["OverPercent"] == "" ? "0" : _bll.Model["OverPercent"]; cbx_MustApplyFirst.Checked = _bll.Model["MustApplyFirst"] != "N"; cbx_IsDisable.Checked = _bll.Model["IsDisable"] == "Y"; cbx_CanApplyInGeneralFlow.Checked = _bll.Model["CanApplyInGeneralFlow"] != "N"; txt_MonthsOverdue.Text = _bll.Model["MonthsOverdue"] == "" ? "1" : _bll.Model["MonthsOverdue"]; txt_YFMonthsOverdue.Text = _bll.Model["YFMonthsOverdue"] == "" ? "1" : _bll.Model["YFMonthsOverdue"]; if (_bll.Model.Level != 0) { lbl_LevelName.Text = DictionaryBLL.GetDicCollections("AC_AccountTitleLevel")[_bll.Model.Level.ToString()].Name; } if (_bll.Model.Level > 3) { cbl_FeeType.Enabled = false; } else { cbl_FeeType.Enabled = true; } cbl_FeeType.Items.Clear(); cbl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType"); cbl_FeeType.DataBind(); foreach (AC_AccountTitleInFeeType item in AC_AccountTitleInFeeTypeBLL.GetModelList("AccountTitle=" + ID.ToString())) { cbl_FeeType.Items.FindByValue(item.FeeType.ToString()).Selected = true; } btn_Save.Text = "修改"; btn_Save.ForeColor = System.Drawing.Color.Red; btn_Delete.Visible = true; MessageBox.ShowConfirm(btn_Delete, "数据删除将不可恢复,确定删除么?"); btn_Cancel.Visible = true; bt_AddSub.Visible = true; lbl_AlertInfo.Text = ""; if ((int)ViewState["ID"] == 1) { btn_Save.Enabled = false; } else { btn_Save.Enabled = true; } btn_Delete.Visible = AC_AccountTitleBLL.GetModelList("SuperID=" + ViewState["ID"].ToString()).Count == 0; }
private void BindTree(TreeNodeCollection TNC, int SuperID) { AC_AccountTitleBLL _bll = new AC_AccountTitleBLL(); IList<AC_AccountTitle> _modellist = _bll._GetModelList("SuperID=" + SuperID.ToString()); foreach (AC_AccountTitle _model in _modellist) { TreeNode tn = new TreeNode(); tn.Text = _model.Name; tn.Value = _model.ID.ToString(); TNC.Add(tn); if (_model.ID == 1) BindTree(tn.ChildNodes, _model.ID); } }
protected void btn_Save_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] == 1) { return; } AC_AccountTitleBLL _bll; if ((int)ViewState["ID"] == 0) { _bll = new AC_AccountTitleBLL(); } else { _bll = new AC_AccountTitleBLL((int)ViewState["ID"]); } _bll.Model.Name = tbx_Name.Text; _bll.Model.SuperID = int.Parse(tree_SuperID.SelectValue); _bll.Model.Code = tbx_Code.Text; _bll.Model.Description = tbx_Description.Text; _bll.Model.Level = new AC_AccountTitleBLL(_bll.Model.SuperID).Model.Level + 1; _bll.Model["OverPercent"] = tbx_OverPercent.Text; _bll.Model["MustApplyFirst"] = cbx_MustApplyFirst.Checked ? "Y" : "N"; _bll.Model["IsDisable"] = cbx_IsDisable.Checked ? "Y" : "N"; _bll.Model["CanApplyInGeneralFlow"] = cbx_CanApplyInGeneralFlow.Checked ? "Y" : "N"; int MonthsOverdue = 1, YFMonthsOverdue = 1; int.TryParse(txt_YFMonthsOverdue.Text.Trim(), out YFMonthsOverdue); int.TryParse(txt_MonthsOverdue.Text.Trim(), out MonthsOverdue); _bll.Model["MonthsOverdue"] = MonthsOverdue.ToString(); _bll.Model["YFMonthsOverdue"] = YFMonthsOverdue.ToString(); if (DictionaryBLL.GetDicCollections("AC_AccountTitleLevel")[_bll.Model.Level.ToString()] == null) { lbl_AlertInfo.Text = "添加会计科目失败,等级超出范围"; return; } if ((int)ViewState["ID"] == 0) { int ret = _bll.Add(); if (ret < 0) { lbl_AlertInfo.Text = "添加会计科目失败,会计科目名称已存在"; return; } _bll.Model.ID = ret; } else { if (_bll.Model.SuperID == _bll.Model.ID) { return; } int ret = _bll.Update(); switch (ret) { case -1: lbl_AlertInfo.Text = "更新会计科目失败,会计科目名称已存在"; return; case -2: lbl_AlertInfo.Text = "更新会计科目失败,不能将当前会计科目设置为上级会计科目"; return; case -3: lbl_AlertInfo.Text = "更新会计科目失败,不能将当前会计科目的子会计科目设置为上级会计科目"; return; } } IList <AC_AccountTitleInFeeType> lists = AC_AccountTitleInFeeTypeBLL.GetModelList("AccountTitle=" + _bll.Model.ID); foreach (ListItem item in cbl_FeeType.Items) { if (item.Selected) { if (lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value) == null) { AC_AccountTitleInFeeTypeBLL b = new AC_AccountTitleInFeeTypeBLL(); b.Model.AccountTitle = _bll.Model.ID; b.Model.FeeType = int.Parse(item.Value); b.Add(); } } else { if (lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value) != null) { AC_AccountTitleInFeeTypeBLL b = new AC_AccountTitleInFeeTypeBLL(lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value).ID); b.Delete(); } } } DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_Pub.dbo.AC_AccountTitle"); Response.Redirect("AccountTitle.aspx?SuperID=" + _bll.Model.SuperID.ToString()); }
protected void btn_Save_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] == 1) return; AC_AccountTitleBLL _bll; if ((int)ViewState["ID"] == 0) { _bll = new AC_AccountTitleBLL(); } else { _bll = new AC_AccountTitleBLL((int)ViewState["ID"]); } _bll.Model.Name = tbx_Name.Text; _bll.Model.SuperID = int.Parse(tree_SuperID.SelectValue); _bll.Model.Code = tbx_Code.Text; _bll.Model.Description = tbx_Description.Text; _bll.Model.Level = new AC_AccountTitleBLL(_bll.Model.SuperID).Model.Level + 1; _bll.Model["OverPercent"] = tbx_OverPercent.Text; _bll.Model["MustApplyFirst"] = cbx_MustApplyFirst.Checked ? "Y" : "N"; _bll.Model["IsDisable"] = cbx_IsDisable.Checked ? "Y" : "N"; _bll.Model["CanApplyInGeneralFlow"] = cbx_CanApplyInGeneralFlow.Checked ? "Y" : "N"; int MonthsOverdue = 1, YFMonthsOverdue=1; int.TryParse(txt_YFMonthsOverdue.Text.Trim(), out YFMonthsOverdue); int.TryParse(txt_MonthsOverdue.Text.Trim(), out MonthsOverdue); _bll.Model["MonthsOverdue"] = MonthsOverdue.ToString(); _bll.Model["YFMonthsOverdue"] = YFMonthsOverdue.ToString(); if (DictionaryBLL.GetDicCollections("AC_AccountTitleLevel")[_bll.Model.Level.ToString()] == null) { lbl_AlertInfo.Text = "添加会计科目失败,等级超出范围"; return; } if ((int)ViewState["ID"] == 0) { int ret = _bll.Add(); if (ret < 0) { lbl_AlertInfo.Text = "添加会计科目失败,会计科目名称已存在"; return; } _bll.Model.ID = ret; } else { if (_bll.Model.SuperID == _bll.Model.ID) return; int ret = _bll.Update(); switch (ret) { case -1: lbl_AlertInfo.Text = "更新会计科目失败,会计科目名称已存在"; return; case -2: lbl_AlertInfo.Text = "更新会计科目失败,不能将当前会计科目设置为上级会计科目"; return; case -3: lbl_AlertInfo.Text = "更新会计科目失败,不能将当前会计科目的子会计科目设置为上级会计科目"; return; } } IList<AC_AccountTitleInFeeType> lists = AC_AccountTitleInFeeTypeBLL.GetModelList("AccountTitle=" + _bll.Model.ID); foreach (ListItem item in cbl_FeeType.Items) { if (item.Selected) { if (lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value) == null) { AC_AccountTitleInFeeTypeBLL b = new AC_AccountTitleInFeeTypeBLL(); b.Model.AccountTitle = _bll.Model.ID; b.Model.FeeType = int.Parse(item.Value); b.Add(); } } else { if (lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value) != null) { AC_AccountTitleInFeeTypeBLL b = new AC_AccountTitleInFeeTypeBLL(lists.FirstOrDefault(p => p.FeeType.ToString() == item.Value).ID); b.Delete(); } } } DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_Pub.dbo.AC_AccountTitle"); Response.Redirect("AccountTitle.aspx?SuperID=" + _bll.Model.SuperID.ToString()); }
protected IList <AC_AccountTitle> GetAccountTitleList() { return(AC_AccountTitleBLL.GetListByFeeType((int)ViewState["FeeType"]). Where(p => (p["MustApplyFirst"] == "N" || p.ID == 1)).ToList()); }