private void BindGrid() { string ConditionStr = " PDT_Product.ID NOT IN (SELECT Product FROM MCS_PUB.dbo.PDT_ProductExtInfo WHERE Supplier=" + Session["OwnerClient"].ToString() + ")"; if (tr_List.SelectedValue != "" && tr_List.SelectedValue != "1") { string _categoryids = ""; DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_Pub.dbo.PDT_Category", "ID", "SuperID", tr_List.SelectedValue); for (int i = 0; i < dt.Rows.Count; i++) { _categoryids += dt.Rows[i]["ID"].ToString() + ","; } _categoryids += tr_List.SelectedValue; ConditionStr += " AND PDT_Product.Category IN (" + _categoryids + ")"; } if (tbx_SearchKey.Text != "") { ConditionStr += " AND ("; ConditionStr += " PDT_Product.FullName LIKE '%" + tbx_SearchKey.Text + "%' "; ConditionStr += "OR PDT_Product.ShortName LIKE '%" + tbx_SearchKey.Text + "%' "; ConditionStr += "OR PDT_Product.BarCode LIKE '%" + tbx_SearchKey.Text + "%' "; ConditionStr += "OR PDT_Product.FactoryName LIKE '%" + tbx_SearchKey.Text + "%' "; ConditionStr += "OR PDT_Product.FactoryCode LIKE '%" + tbx_SearchKey.Text + "%' "; ConditionStr += ")"; } gv_List.ConditionString = ConditionStr; gv_List.BindGrid(); }
protected void bt_Add_Click(object sender, EventArgs e) { if (tr_Position.SelectValue != "0") { int position = int.Parse(tr_Position.SelectValue); int beginday = int.Parse(tbx_BeginDay.Text); int endday = int.Parse(tbx_EndDay.Text); EWF_Flow_InitPositionBLL bll = new EWF_Flow_InitPositionBLL(); bll.Model.App = (Guid)ViewState["AppID"]; bll.Model.Position = position; bll.Model.BeginDay = beginday; bll.Model.EndDay = endday; bll.Add(); if (cb_IncludeChild.Checked) { DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_SYS.dbo.Org_Position", "ID", "SuperID", tr_Position.SelectValue); foreach (DataRow dr in dt.Rows) { bll.Model.ID = Guid.NewGuid(); bll.Model.Position = (int)dr["ID"]; bll.Add(); } } } BindGrid(); }
private void FillDataSource() { try { if (ViewState["SqlString"] != null && ViewState["SqlString"].ToString() != "") { int TotalRecordCount = 0; string _sqlstring = ViewState["SqlString"].ToString(); if (ConditionString != "") { _sqlstring += " WHERE " + ConditionString; } string DBConnectString = null; if (ViewState["DBConnectString"] != null) { DBConnectString = (string)ViewState["DBConnectString"]; } if (AllowPaging) { DataSource = TreeTableBLL.ExecSqlString(DBConnectString, _sqlstring, PageSize, PageIndex, OrderFields, out TotalRecordCount); } else { DataSource = TreeTableBLL.ExecSqlString(DBConnectString, _sqlstring, 999999, 0, OrderFields, out TotalRecordCount); } ViewState["TotalRecordCount"] = TotalRecordCount; } } catch (System.Exception err) { LogWriter.WriteLog("UC_GridView.FillDataSource: TreeTableBLL.ExecSqlString Error!", err); LogWriter.WriteLog(ViewState["SqlString"].ToString()); } }
private void BindData() { int id = (int)ViewState["ID"]; ORD_OrderApply apply = new ORD_OrderApplyBLL(id).Model; if (apply == null) { Response.Redirect("FeeApplyList.aspx"); } pn_OrderApply.BindData(apply); ViewState["Type"] = apply.Type; int month = new AC_AccountMonthBLL(apply.AccountMonth).Model.Month; ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL(); ViewState["Limit"] = limitbll.GetLimitInfo(apply.AccountMonth, apply.Client); #region 绑定当前申请单的管理片区 Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity"); lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity); #endregion BindGrid(); }
protected void ddl_Brand_SelectedIndexChanged(object sender, EventArgs e) { if (tr_OrganizeCity.SelectValue != "0") { DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue)); string citys = ""; for (int i = 0; i < dt.Rows.Count; i++) { citys += dt.Rows[i]["ID"].ToString(); if (i < dt.Rows.Count - 1) { citys += ","; } } string condition = "ToOrganizeCity IN (" + citys + ") AND GETDATE() BETWEEN BeginTime AND DateAdd(day,1,EndTime) AND State=2 AND Type=" + rbl_Type.SelectedValue + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',1)=" + ddl_Brand.SelectedValue; IList <ORD_ApplyPublish> list = ORD_ApplyPublishBLL.GetModelList(condition); ddl_Publish.DataTextField = "Topic"; ddl_Publish.DataValueField = "ID"; ddl_Publish.DataSource = list; ddl_Publish.DataBind(); if (list.Count == 0) { ddl_Publish.Items.Insert(0, new ListItem("当前无可以申请的产品目录", "0")); bt_Confirm.Enabled = false; } else { bt_Confirm.Enabled = true; } } }
protected void bt_Submit_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] != 0) { bt_OK_Click(null, null); FNA_BudgetExtraApplyBLL bll = new FNA_BudgetExtraApplyBLL((int)ViewState["ID"]); #region 发起工作流 NameValueCollection dataobjects = new NameValueCollection(); dataobjects.Add("ID", ViewState["ID"].ToString()); dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString()); dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString()); dataobjects.Add("ExtraAmount", bll.Model.ExtraAmount.ToString("0.##")); dataobjects.Add("FeeType", bll.Model.FeeType.ToString()); dataobjects.Add("ExtraType", bll.Model["ExtraType"]); dataobjects.Add("SupportOrganizeCity", bll.Model["SupportOrganizeCity"]); #region 组合审批任务主题 string title = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", bll.Model.OrganizeCity) + " 申请扩增预算额度,申请扩增额度:" + bll.Model.ExtraAmount.ToString("0.##"); #endregion int TaskID = EWF_TaskBLL.NewTask("FNA_BudgetExtraApplyFlow", (int)Session["UserID"], title, "~/SubModule/FNA/Budget/BudgetExtraApplyDetail.aspx?ID=" + ViewState["ID"].ToString(), dataobjects); if (TaskID <= 0) { MessageBox.Show(this, "对不起,工作流发起失败,请与管理员联系!"); return; } bll.Submit((int)Session["UserID"], TaskID); new EWF_TaskBLL(TaskID).Start(); //直接启动流程 #endregion MessageBox.ShowAndRedirect(this, "预算扩增提交成功!", Page.ResolveClientUrl("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString())); } }
void BindBudget(int month, int organizecity, int feetype) { lb_Balance.Text = FNA_BudgetBLL.GetUsableAmount(month, organizecity, feetype).ToString("0.##"); int city = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OrganizeCity", organizecity, 1); lb_DepartmentBalance.Text = FNA_BudgetBLL.GetUsableAmount(month, city, feetype, false).ToString(); }
private void BindGrid() { if (ViewState["Details"] != null) { ListTable <PBM_DeliveryDetail> Details = (ListTable <PBM_DeliveryDetail>)ViewState["Details"]; int category = 1; int.TryParse(tr_Category.SelectValue, out category); if (category > 1) { DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_PUB.dbo.PDT_Category", "ID", "SuperID", category.ToString()); List <int> categorys = new List <int>(); foreach (DataRow dr in dt.Rows) { categorys.Add((int)dr["ID"]); } categorys.Add(category); gv_List.BindGrid(Details.GetListItem().Where(p => categorys.Contains(new PDT_ProductBLL(p.Product).GetProductExtInfo((int)Session["OwnerClient"]).Category)).ToList()); } else { gv_List.BindGrid(Details.GetListItem()); } if (Details.GetListItem().Count == 0) { bt_Confirm.Visible = false; } } }
private void BindDropDown() { MCSTreeControl tr_OfficialCity = (MCSTreeControl)pl_detail.FindControl("CM_Client_OfficialCity"); if (tr_OfficialCity != null) { if ((int)Session["OwnerType"] == 2 && (int)Session["OwnerClient"] > 0) { CM_Client c = new CM_ClientBLL((int)Session["OwnerClient"]).Model; if (c != null) { int prov = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OfficialCity", c.OfficialCity, 1); tr_OfficialCity.RootValue = prov.ToString(); } } } if ((int)Session["OwnerType"] == 2 && (int)Session["OrganizeCity"] > 1) { DropDownList ddl_VisitRoute = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_VisitRoute"); if (ddl_VisitRoute != null) { ddl_VisitRoute.DataValueField = "ID"; ddl_VisitRoute.DataTextField = "Name"; ddl_VisitRoute.DataSource = VST_RouteBLL.GetByOrganizeCity((int)Session["OrganizeCity"]); ddl_VisitRoute.DataBind(); ddl_VisitRoute.Items.Insert(0, new ListItem("请选择...", "0")); } } }
private void BindCheckBoxList() { if ((int)ViewState["Insurance"] > 0) { cbl_ApplyCity.Items.Clear(); PM_StdInsuranceCostBLL bll = new PM_StdInsuranceCostBLL((int)ViewState["Insurance"]); IList <PM_StdInsuranceCostInCity> pms = PM_StdInsuranceCostInCityBLL.GetModelList("Insurance=" + (int)ViewState["Insurance"]); foreach (PM_StdInsuranceCostInCity p in pms) { string cityname = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", p.City); cbl_ApplyCity.Items.Add(new ListItem(cityname, p.ID.ToString())); } tr_OrganizeCity.DataSource = TreeTableBLL.GetAllChildNodeByNodes("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", "1"); tr_OrganizeCity.RootValue = "1"; tr_OrganizeCity.SelectValue = tr_OrganizeCity.RootValue; if (bll.Model.ApproveFlag == 1) { bt_Add.Visible = false; bt_Delete.Visible = false; tr_OrganizeCity.Enabled = false; } } }
protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e) { #region 限定选择提成计算方法的范围只能是当前片区 DropDownList ddl_SalaryGrade = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_SalaryGrade"); if (ddl_SalaryGrade != null) { try { ddl_SalaryGrade.DataTextField = "Name"; ddl_SalaryGrade.DataValueField = "ID"; string orgcitys = ""; DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue)); foreach (DataRow dr in dt.Rows) { if (dr["ID"].ToString() != "") { orgcitys += "," + dr["ID"].ToString(); } } if (orgcitys.Length > 1) { orgcitys = orgcitys.Substring(1, orgcitys.Length - 1); } ddl_SalaryGrade.DataSource = PM_SalaryLevelBLL.GetModelList("OrganizeCity in (" + orgcitys + ")"); ddl_SalaryGrade.DataBind(); } catch { } ddl_SalaryGrade.Items.Insert(0, new ListItem("请选择", "0")); } #endregion }
protected void btn_Search_Click(object sender, EventArgs e) { if (select_Client.SelectValue == "" || select_Client.SelectValue == "0") { int level = int.Parse(ddl_Level.SelectedValue); string citys = ""; DataTable dt = TreeTableBLL.GetAllChildNodeByNodes("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", tr_OrganizeCity.SelectValue); if (level > 0) { foreach (DataRow row in dt.Select("Level=" + level)) { citys += row["ID"] + ","; } citys = citys.Substring(0, citys.Length - 1); } else { citys = tr_OrganizeCity.SelectValue; } ListTable <PDT_ClassifyGiftCostRate> _details = new ListTable <PDT_ClassifyGiftCostRate> (PDT_ClassifyGiftCostRateBLL.GetModelList("OrganizeCity in (" + citys + ") "), "ID"); ViewState["Details"] = _details; } else { ListTable <PDT_ClassifyGiftCostRate> _details = new ListTable <PDT_ClassifyGiftCostRate> (PDT_ClassifyGiftCostRateBLL.GetModelList("Client=" + select_Client.SelectValue), "ID"); ViewState["Details"] = _details; } BindGrid(); }
private void ExpandNode() { DataTable _fullpath = TreeTableBLL.GetFullPath("MCS_Pub.dbo.PDT_Category", "ID", "SuperID", (int)ViewState["ID"]); for (int i = 0; i < _fullpath.Rows.Count; i++) { int _id = int.Parse(_fullpath.Rows[i]["ID"].ToString()); if (_id != 1) { string _valuepath = ""; for (int j = 0; j <= i; j++) { _valuepath += _fullpath.Rows[j]["ID"].ToString() + "/"; } _valuepath = _valuepath.Substring(0, _valuepath.Length - 1); TreeNode node = tr_List.FindNode(_valuepath); if (node != null) { if (node.ChildNodes.Count == 0) { BindTree(node.ChildNodes, _id); } node.Expand(); node.Selected = true; } } } }
protected void tr_OfficialCity_Selected(object sender, MCSControls.MCSWebControls.SelectedEventArgs e) { cbl_OfficialList.Items.Clear(); DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_SYS.dbo.Addr_OfficialCity", "ID", "SuperID", tr_OfficialCity.SelectValue); for (int i = 0; i < dt.Rows.Count; i++) { Addr_OfficialCityBLL city = new Addr_OfficialCityBLL((int)dt.Rows[i]["ID"]); if (city.Model.Level == 3) { string fullname = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OfficialCity", city.Model.ID); ListItem item = new ListItem(fullname, city.Model.ID.ToString()); IList <Addr_OfficialCityInOrganizeCity> organizecitys = Addr_OfficialCityInOrganizeCityBLL.GetModelList("OfficialCity=" + city.Model.ID.ToString()); if (organizecitys.Count > 0) { Addr_OrganizeCity organizecity = new Addr_OrganizeCityBLL(organizecitys[0].OrganizeCity).Model; if (organizecity != null) { item.Text += "; 已归属于片区:【" + organizecity.Name + "】"; } item.Enabled = false; } cbl_OfficialList.Items.Add(item); } } }
private void BindBudgetInfo(int city, int month, int client, int feetype, int productbrand, int giftclassify, int receiver) { lb_OrganizeCityName.Text = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", city); lb_ClientName.Text = client == 0 ? "" : new CM_ClientBLL(client).Model.FullName; lb_Receiver.Text = (receiver == 0 || receiver == null) ? "" : new CM_ClientBLL(receiver).Model.FullName; decimal totalbudget = FNA_BudgetBLL.GetUsableAmount(month, city, feetype, false); lb_TotalBudget.Text = totalbudget.ToString("0.##"); IList <ORD_GiftApplyAmount> giftamounts = ORD_GiftApplyAmountBLL.GetModelList( string.Format("AccountMonth={0} AND Client={1} AND Brand={2} AND Classify={3}", month, client, productbrand, giftclassify)); if (giftamounts.Count > 0) { decimal available = giftamounts[0].AvailableAmount + giftamounts[0].PreBalance - giftamounts[0].DeductibleAmount; decimal balance = giftamounts[0].BalanceAmount; ViewState["SalesVolume"] = giftamounts[0].SalesVolume; lb_AvailableAmount.Text = available.ToString("0.##"); lb_BalanceAmount.Text = balance.ToString("0.##"); //2012-3-27 暂时只取赠品额度,不取预算 //lb_BalanceAmount.Text = (totalbudget > balance ? balance : totalbudget).ToString("0.##"); } else { lb_AvailableAmount.Text = "0"; lb_BalanceAmount.Text = "0"; } hl_ViewBudget.NavigateUrl = "~/SubModule/FNA/Budget/BudgetBalance.aspx?OrganizeCity=" + city.ToString(); }
public void GetTotalRecordCount() { try { if (ViewState["SqlString"] != null && ViewState["SqlString"].ToString() != "") { int TotalRecordCount = 0; string _sqlstring = ViewState["SqlString"].ToString(); if (ConditionString != "") { _sqlstring += " WHERE " + ConditionString; } string DBConnectString = null; if (ViewState["DBConnectString"] != null) { DBConnectString = (string)ViewState["DBConnectString"]; } TreeTableBLL.ExecSqlStringByTotalCount(DBConnectString, _sqlstring, out TotalRecordCount); ViewState["TotalRecordCount"] = TotalRecordCount; } } catch (System.Exception err) { LogWriter.WriteLog("UC_GridView.FillDataSource: TreeTableBLL.ExecSqlString Error!", err); LogWriter.WriteLog(ViewState["SqlString"].ToString()); } }
private void BindGrid() { lbl_message.Text = "费用报销审批汇总表"; int id = (int)ViewState["ID"]; FNA_FeeWriteOffBLL bll = new FNA_FeeWriteOffBLL(id); ViewState["Details"] = bll.Items.OrderBy(p => p.Client).ThenBy(p => p.AccountTitle).ThenBy(p => p.BeginMonth).ToList(); FNA_FeeWriteOff writeoff = bll.Model; if (writeoff == null) { Response.Redirect("FeeWriteOffList.aspx"); } BindGridPrint(); string type = ""; if (writeoff["InvoiceClassAB"] != "") { type = DictionaryBLL.GetDicCollections("FNA_InvoiceClassAB")[writeoff["InvoiceClassAB"]].Name; } // type = DictionaryBLL.Dictionary_Data_GetAlllList("TableName='FNA_InvoiceClassAB' AND Code='" + writeoff["InvoiceClassAB"] + "'")[0].Name; if (type == "") { type = "抵款"; } span_sheetcode.InnerText = writeoff.SheetCode; span_accountmonth.InnerText = new AC_AccountMonthBLL(writeoff.AccountMonth).Model.Name; if (bll.Model["InsteadPayStaff"] != "" && bll.Model["InsteadPayStaff"] != "0") { p_ddtype.InnerText = "员工"; span_client.InnerText = new Org_StaffBLL(int.Parse(bll.Model["InsteadPayStaff"])).Model.RealName; } else { span_client.InnerText = new CM_ClientBLL(writeoff.InsteadPayClient).Model.FullName; } int city5 = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OrganizeCity", writeoff.OrganizeCity, 5); span_orgnizecity.InnerText = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", 1, city5 > 0 ? city5 : writeoff.OrganizeCity); span_type.InnerText = type; span1.InnerText = span2.InnerText = "1"; //求费用核消金额合计 decimal _totalcost = 0; foreach (FNA_FeeWriteOffDetail _detail in bll.Items) { _totalcost += _detail.WriteOffCost + _detail.AdjustCost; } lab_SubTotalCostCN.Text = MCSFramework.Common.Rmb.CmycurD(_totalcost.ToString()); lab_SubTotalCost.Text = _totalcost.ToString("#,##0.00"); lab_SubTotalCost.Text = lab_SubTotalCost.Text; lab_SubTotalCost.Text = lab_SubTotalCost.Text; }
protected void gv_ListDetail_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int id = (int)gv_ListDetail.DataKeys[e.Row.RowIndex][0]; UC_GridView gv_Detail = (UC_GridView)e.Row.FindControl("gv_Detail"); if (gv_Detail != null) { IList <FNA_FeeWriteOffDetail> lists = new FNA_FeeWriteOffBLL(id).Items; //费用类型 int accounttile = 0; int.TryParse(tr_AccountTitle.SelectValue, out accounttile); if (ddl_FeeType.SelectedValue != "0" && !(accounttile > 1)) { IList <AC_AccountTitleInFeeType> titles = AC_AccountTitleInFeeTypeBLL.GetModelList("FeeType=" + ddl_FeeType.SelectedValue); int[] ids = new int[titles.Count]; for (int i = 0; i < titles.Count; i++) { ids[i] = titles[i].AccountTitle; } lists = lists.Where(p => ids.Contains(p.AccountTitle)).ToList(); } //费用科目 if (accounttile > 1) { DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_PUB.dbo.AC_AccountTitle", "ID", "SuperID", accounttile.ToString()); int[] ids = new int[dt.Rows.Count + 1]; for (int i = 0; i < dt.Rows.Count; i++) { ids[i] = (int)dt.Rows[i]["ID"]; } ids[ids.Length - 1] = accounttile; lists = lists.Where(p => ids.Contains(p.AccountTitle)).ToList(); } //核销金额判断 decimal _cost = 0; decimal.TryParse(tbx_WriteOffCost.Text, out _cost); if (_cost != 0) { if (ddl_WriteOffCostOP.SelectedValue == ">") { lists = lists.Where(p => p.WriteOffCost + p.AdjustCost > _cost).ToList(); } else if (ddl_WriteOffCostOP.SelectedValue == "<") { lists = lists.Where(p => p.WriteOffCost + p.AdjustCost < _cost).ToList(); } } gv_Detail.BindGrid(lists); } } }
/// <summary> /// 获取指定城市的全名 /// </summary> /// <param name="AuthKey">匿名用户登录后的认证码</param> /// <param name="CityID"></param> /// <returns></returns> public static string GetCityFullName(UserInfo User, int CityID) { LogWriter.WriteLog("OfficialCityService.GetCityFullName:UserName="******",CityID=" + CityID.ToString()); if (CityID <= 1) { return("中国"); } return(TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OfficialCity", CityID).Replace("->", " ")); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ViewState["Client"] = Request.QueryString["Client"] == null ? 0 : int.Parse(Request.QueryString["Client"]); ViewState["OrganizeCity"] = Request.QueryString["OrganizeCity"] == null ? 0 : int.Parse(Request.QueryString["OrganizeCity"]); BindDropDown(); if ((int)ViewState["Client"] != 0) { select_Client.SelectValue = ViewState["Client"].ToString(); select_Client.SelectText = new CM_ClientBLL((int)ViewState["Client"]).Model.FullName; } else if ((int)ViewState["OrganizeCity"] != 0) { tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString(); } if (select_Client.SelectValue == "" || select_Client.SelectValue == "0") { int level = int.Parse(ddl_Level.SelectedValue); string citys = ""; Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue)); DataTable dt = TreeTableBLL.GetAllChildNodeByNodes("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", tr_OrganizeCity.SelectValue); if (level > 0) { foreach (DataRow row in dt.Select("Level=" + level)) { citys += row["ID"] + ","; } citys = citys.Substring(0, citys.Length - 1); } else { citys = tr_OrganizeCity.SelectValue; } ListTable <PDT_ClassifyGiftCostRate> _details = new ListTable <PDT_ClassifyGiftCostRate> (PDT_ClassifyGiftCostRateBLL.GetModelList("OrganizeCity in (" + citys + ") "), "ID"); ViewState["Details"] = _details; } else { ListTable <PDT_ClassifyGiftCostRate> _details = new ListTable <PDT_ClassifyGiftCostRate> (PDT_ClassifyGiftCostRateBLL.GetModelList("Client=" + select_Client.SelectValue), "ID"); ViewState["Details"] = _details; } ViewState["MAXID"] = ((ListTable <PDT_ClassifyGiftCostRate>)ViewState["Details"]).GetListItem().Count > 0 ? ((ListTable <PDT_ClassifyGiftCostRate>)ViewState["Details"]).GetListItem().Max(p => p.ID) : 0; BindGrid(); } }
private void BindKBGridView(UC_GridView gv_KB, int Catalog) { DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_OA.dbo.KB_Catalog", "ID", "SuperID", Catalog.ToString()); string catalogs = Catalog.ToString(); foreach (DataRow dr in dt.Rows) { catalogs += "," + dr["ID"].ToString(); } string condition = "ID IN(Select TOP 3 ID FROM MCS_OA.dbo.KB_Article WHERE Catalog IN (" + catalogs + ") AND IsDelete = 'N' AND HasApproved = 'Y' ORDER BY ApproveTime DESC)"; gv_KB.BindGrid(KB_ArticleBLL.GetModelList(condition)); gv_KB.Attributes["CatalogID"] = Catalog.ToString(); }
protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e) { Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity"); lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", e.CurSelectIndex); Label lb_SheetCode = (Label)pn_OrderApply.FindControl("ORD_OrderApply_SheetCode"); lb_SheetCode.Text = ORD_OrderApplyBLL.GenerateSheetCode(e.CurSelectIndex, AC_AccountMonthBLL.GetCurrentMonth()); MCSSelectControl select_Client = (MCSSelectControl)pn_OrderApply.FindControl("ORD_OrderApply_Client"); select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=2&OrganizeCity=" + e.CurSelectIndex; }
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"; } }
protected string DisplayFullInfo(string loginname) { string ret = ""; Org_Staff staff = UserBLL.GetStaffByUsername(loginname); ret = "登录名称:<a href=\"javascript:SendMsg('" + loginname + "','" + Server.UrlPathEncode(staff.RealName) + "');\" title='发送短内短信' style='color:red' target='_self'>" + loginname + "</a>"; ret += "<br/>真实姓名:" + staff.RealName + "<br/>所属区域:" + TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", 0, staff.OrganizeCity); Org_Position p = new Org_PositionBLL(staff.Position).Model; if (p != null) { ret += "<br/>职位:" + p.Name; } return(ret); }
public string GetAllChildPosition() { DataTable dt = TreeTableBLL.GetAllChildByNodes("MCS_OA.dbo.KB_Catalog", "ID", "SuperID", _m.ID.ToString()); string ids = ""; for (int i = 0; i < dt.Rows.Count; i++) { if (ids != "") { ids += ","; } ids += dt.Rows[i]["ID"]; } return(ids); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //初始化当前目录ID ViewState["FolderID"] = Request.QueryString["FolderID"] != null ? Request.QueryString["FolderID"].ToString() : "76"; //上层目录 Rpt_FolderBLL fbll = new Rpt_FolderBLL(int.Parse((string)ViewState["FolderID"])); superid = fbll.Model.SuperID != 0 ? fbll.Model.SuperID : 1; //当前目录路径 //pathname = TreeTableBLL.GetFullPathName("MCS_Reports.dbo.Rpt_Folder", "ID", "Name", "SuperID", 0, int.Parse((string)ViewState["FolderID"])); pathname = TreeTableBLL.GetFullPathName("MCS_Reports.dbo.Rpt_Folder", int.Parse((string)ViewState["FolderID"])); BindData(); } }
private string GetRelateTextByValue(Rpt_DataSetParams param, string value) { if (param.RelationType == 1) { //关联字典表 return(DictionaryBLL.GetDicCollections(param.RelationTableName, false)[value].Name); } else if (param.RelationType == 2) { //关联实体表 return(TreeTableBLL.GetRelationTableDataValue(param.RelationTableName, param.RelationValueField, param.RelationTextField, value)); } else { return(value); } }
private string GetRelateTextByValue(UD_ModelFields field, string value) { if (field.RelationType == 1) { //关联字典表 return(DictionaryBLL.GetDicCollections(field.RelationTableName, false)[value].Name); } else if (field.RelationType == 2) { //关联实体表 return(TreeTableBLL.GetRelationTableDataValue(field.RelationTableName, field.RelationValueField, field.RelationTextField, value)); } else { return(value); } }
public void BindDropDown() { MCSTreeControl tr_OfficialCity = (MCSTreeControl)pl_detail.FindControl("CM_Client_OfficialCity"); if (tr_OfficialCity != null) { if ((int)Session["OwnerType"] == 2 && (int)Session["OwnerClient"] > 0) { CM_Client c = new CM_ClientBLL((int)Session["OwnerClient"]).Model; if (c != null) { int prov = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OfficialCity", c.OfficialCity, 1); tr_OfficialCity.RootValue = prov.ToString(); } } } }
private void BindData() { FNA_FeeApplyDetail m = new FNA_FeeApplyBLL().GetDetailModel((int)ViewState["ID"]); if (m.AccountTitle == 82) { tb_DIFL.Visible = true; } lb_AccountTitle.Text = TreeTableBLL.GetFullPathName("MCS_Pub.dbo.AC_AccountTitle", m.AccountTitle); lb_ApplyCost.Text = m.ApplyCost.ToString("0.###"); tbx_ApproveCost.Text = (m.ApplyCost + m.AdjustCost).ToString("0.###"); lbl_DICost.Text = m.DICost.ToString("0.###"); tbx_ApproveDICost.Text = (m.DICost + m.DIAdjustCost).ToString("0.###"); }