private void pageInit(bool start) { string sql = "select * from CRM_Logs where LogType=8 or LogType=9"; var supplierData = WX.Main.GetPagedRows(sql, 0, "ORDER BY ID desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }
private void dataBind(bool start) { string sql = "select * from CRM_Customer_Label" + (Gv_customer.Rows.Count > 0 && ((DropDownList)Gv_customer.HeaderRow.FindControl("DropDownList1")).SelectedValue != "0" ? " where Type=" + ((DropDownList)Gv_customer.HeaderRow.FindControl("DropDownList1")).SelectedValue : "");// + ((DropDownList)Gv_customer.HeaderRow.FindControl("DropDownList1")).SelectedValue; var supplierData = WX.Main.GetPagedRows(sql, 0, "ORDER BY id desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } for (int i = 0; i < WX.CRM.Customer_Temp.TypeStr.Length; i++) { ((DropDownList)Gv_customer.HeaderRow.FindControl("DropDownList1")).Items.Add(new ListItem(WX.CRM.Customer_Temp.TypeStr[i], i.ToString())); } }
private void pageInit(bool start) { string sql = "select ccp.*,cc.CustomerName,tu.RealName,ct.State TrackState from CRM_CustomerProgram ccp left join CRM_Customers cc on ccp.CustomerID=cc.ID left join TU_Users tu on ccp.UserID=tu.UserID left join CRM_Track ct on ccp.TrackID=ct.ID where cc.EmployeeID='" + WX.Main.CurUser.UserID + "'"; var supplierData = WX.Main.GetPagedRows(sql, 0, "ORDER BY ProgramTime desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }
private void pageInit(bool start) { string sql = "select cca.*,cc.CustomerName,tu.RealName,ct.State TrackState,tu2.RealName CheckUserName from CRM_CustomerAgreement cca left join CRM_Customers cc on cca.CustomerID=cc.ID left join TU_Users tu on cca.UserID=tu.UserID left join TU_Users tu2 on cca.CheckUser=tu2.UserID left join CRM_Track ct on cca.TrackID=ct.ID" + (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() < 900 ? " where cc.EmployeeID in(select UserID from Tu_Users where DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString() + ")" : ""); var supplierData = WX.Main.GetPagedRows(sql, 0, "ORDER BY StartTime desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }
private void InitCustomerRepeater() { WX.Main.CurUser.LoadDutyDetailUser(); string sql = "SELECT C.ID,C.CustomerID,C.CustomerName,tu.RealName,CA.CategoryName,CN.CompanyNature,CI.IndustryName,CB.LevelName,CStage.StageName,C.CustomersID,C.State,1 checktype,0 ContactID FROM CRM_CustomersTemp AS C " // + " inner JOIN CRM_Customers AS Customers ON C.CustomersID=Customers.ID " + " left JOIN CRM_InnerCategory AS CA ON C.CategoryID=CA.ID " + " left JOIN CRM_CompanyNature AS CN ON C.NatureID=CN.ID" + " left join TU_Users tu on C.EmployeeID=tu.UserID" + " Left Join CRM_Industry As CI On C.IndustryID=CI.Id" + " Left Join CRM_BusinessLevel As CB On C.BusinessLevel=CB.Id" + " Left Join CRM_Stage As CStage On C.StageId=CStage.Id where C.State>-1" + (WX.Main.CurUser.UserID == WX.CommonUtils.GetBossUserID || ids == "" ? "" : " and tu.DepartmentID in(" + ids + ")") + " union all " + " SELECT cctemp.ID,C.CustomerID,C.CustomerName,tu.RealName,CA.CategoryName,CN.CompanyNature,CI.IndustryName," + " CB.LevelName,CStage.StageName,cctemp.CustomerID,cctemp.State State,2 checktype,cctemp.ContactID FROM CRM_ContactTemp as cctemp" + " left join CRM_Customers AS C on cctemp.CustomerID=C.ID" + " left join TU_Users tu on C.EmployeeID=tu.UserID" + " left JOIN CRM_InnerCategory AS CA ON C.CategoryID=CA.ID" + " left JOIN CRM_CompanyNature AS CN ON C.NatureID=CN.ID" + " Left Join CRM_Industry As CI On C.IndustryID=CI.Id" + " Left Join CRM_BusinessLevel As CB On C.BusinessLevel=CB.Id" + " Left Join CRM_Stage As CStage On C.StageId=CStage.Id" + " where cctemp.CheckState>-1" + (WX.Main.CurUser.UserID == WX.CommonUtils.GetBossUserID || ids == "" ? "" : " and tu.DepartmentID in(" + ids + ")") + " ORDER BY CustomersID,ID desc"; System.Data.DataTable dataTable = ULCode.QDA.XSql.GetDataTable(sql); Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } }
private void InitCustomerRepeater(bool start) { string sql = "SELECT C.CustomersID ID,C.CustomerID,C.CustomerName,tu.RealName CheckUser,CA.CategoryName,CN.CompanyNature,CI.IndustryName,CS.SourceName,CB.LevelName,CStage.StageName,C.CustomersID,C.State CheckState,C.State,1 checktype,1 ContactID FROM CRM_CustomersTemp AS C " + " left JOIN CRM_InnerCategory AS CA ON C.CategoryID=CA.ID " + " left JOIN CRM_CompanyNature AS CN ON C.NatureID=CN.ID" + " left join TU_Users tu on C.CheckUserId=tu.UserID" + " Left join CRM_Source As CS On C.SourceId=CS.Id" + " Left Join CRM_Industry As CI On C.IndustryID=CI.Id" + " Left Join CRM_BusinessLevel As CB On C.BusinessLevel=CB.Id" + " Left Join CRM_Stage As CStage On C.StageId=CStage.Id" + " where C.EmployeeID='" + WX.Main.CurUser.UserID + "'" + " union all" + " SELECT cctemp.ID,C.CustomerID,C.CustomerName,tu.RealName CheckUser,CA.CategoryName,CN.CompanyNature,CI.IndustryName,CS.SourceName," + " CB.LevelName,CStage.StageName,cctemp.CustomerID,cctemp.CheckState CheckState,cctemp.State,2 checktype,cctemp.ContactID FROM CRM_ContactTemp as cctemp" + " left join CRM_Customers AS C on cctemp.CustomerID=C.ID" + " left join TU_Users tu on cctemp.CheckUserID=tu.UserID" + " left JOIN CRM_InnerCategory AS CA ON C.CategoryID=CA.ID" + " left JOIN CRM_CompanyNature AS CN ON C.NatureID=CN.ID" + " Left join CRM_Source As CS On C.SourceId=CS.Id" + " Left Join CRM_Industry As CI On C.IndustryID=CI.Id" + " Left Join CRM_BusinessLevel As CB On C.BusinessLevel=CB.Id" + " Left Join CRM_Stage As CStage On C.StageId=CStage.Id" + " where C.EmployeeID='" + WX.Main.CurUser.UserID + "' ORDER BY ID desc"; System.Data.DataTable dataTable = ULCode.QDA.XSql.GetDataTable(sql); Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } }
private void pageInit(bool start) { WX.Main.CurUser.LoadDutyDetailUser(); string sql = "select CRM_Logs.* from CRM_Logs left join Tu_Users on CRM_Logs.UserID=Tu_Users.UserID where Tu_Users.DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString(); if (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() >= 900) { sql = "select * from CRM_Logs"; } var supplierData = WX.Main.GetPagedRows(sql, 0, "ORDER BY ID desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }
private void InitCustomerRepeater(bool start) { string sql = "SELECT C.ID,C.CustomerID,C.StageId,C.CustomerName,C.EmployeeID,CA.CategoryName,CN.CompanyNature,CI.IndustryName,CS.SourceName,CB.LevelName,CStage.StageName,C.State,tu.RealName EmployeeName FROM CRM_Customers AS C " + " INNER JOIN CRM_InnerCategory AS CA ON C.CategoryID=CA.ID " + " left JOIN CRM_CompanyNature AS CN ON C.NatureID=CN.ID" + " Left join CRM_Source As CS On C.SourceId=CS.Id" + " Left Join CRM_Industry As CI On C.IndustryID=CI.Id" + " Left Join CRM_BusinessLevel As CB On C.BusinessLevel=CB.Id" + " Left Join CRM_Stage As CStage On C.StageId=CStage.Id" + " Left Join TU_Users As tu On C.EmployeeID=tu.UserID" + " where C.State>0"; if (Request["UserID"] != null && Request["UserID"] != "") { sql = sql + " and C.EmployeeID='" + Request["UserID"] + "'"; } System.Data.DataTable dataTable = WX.Main.GetPagedRows(sql, 0, " ORDER BY ID desc", 20, AspNetPager1.CurrentPageIndex); Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.PageSize = 20; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }
private void pageInit(bool start) { string wherestr = " where 1=1"; //if (Request.QueryString["PageMode"] == "my") //{ // wherestr += " and ct.UserID='" + WX.Main.CurUser.UserID + "'"; //} if (Request["CustomerID"] != null && Request["CustomerID"] != "") { wherestr += " and ct.CustomerID=" + Request["CustomerID"]; } else { if (Request["UserID"] != null && Request["UserID"] != "") { WX.Model.User.MODEL usermodel = WX.Model.User.NewDataModel(Request["UserID"]); wherestr += " and tu.DepartmentID=" + usermodel.DepartmentID.ToString(); } else { WX.Main.CurUser.LoadMyDepartment(); if (WX.CommonUtils.GetBossUserID != WX.Main.CurUser.UserID && WX.Main.CurUser.MyDepartMent.ID.ToString() != System.Configuration.ConfigurationManager.AppSettings["Dept_CA"]) { string ids = WX.Main.GetUserDeptids(WX.Main.CurUser.UserID); wherestr += " and tu.DepartmentID in(" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + ")"; } } } if (Request["fee"] != null && Request["fee"] == "1") { wherestr += " and ct.Fee>0 and ct.State=1"; } if (Request["UserID"] != null && Request["UserID"] != "") { wherestr += " AND cc.EmployeeID='" + Request["UserID"] + "'"; } string sql = "select ct.*,tu.RealName,cc.CustomerName from CRM_Track ct left join CRM_Customers cc on ct.CustomerID=cc.ID left join TU_Users tu on ct.UserID=tu.UserID"; if (Request["type"] != null && Request["type"] == "1") { wherestr += " and ProcessState<5"; this.MenuBar1.CurIndex = 3; } else if (Request["type"] != null && Request["type"] == "2") { wherestr += " and ProcessState>4 and ProcessState<9"; this.MenuBar1.CurIndex = 4; } else if (Request["type"] != null && Request["type"] == "3") { this.MenuBar1.CurIndex = 5; wherestr += " and ProcessState>8"; } var supplierData = WX.Main.GetPagedRows(sql + wherestr, 0, "ORDER BY TrackTime desc", 50, AspNetPager1.CurrentPageIndex); System.Data.DataTable dataTable = supplierData; Gv_customer.DataSource = dataTable; Gv_customer.DataBind(); if (Gv_customer.Rows.Count > 0) { Gv_customer.HeaderRow.TableSection = TableRowSection.TableHeader; Gv_customer.HeaderStyle.Height = Unit.Pixel(40); } this.AspNetPager1.AlwaysShow = true; if (start) { this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql + wherestr); this.AspNetPager1.PageSize = 50; this.AspNetPager1.CurrentPageIndex = 1; } else { this.AspNetPager1.RecordCount = WX.Main.GetPagedRowsCount(sql); this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; } }