internal List <B2b_com_pro> BindingWarrantProlist(int Pageindex, int Pagesize, string Key, int Agentid, int Warrant_type, int bindingcomid, int comid, out int totalcount, int Agentlevel = 0) { B2bComProData prodata = new B2bComProData(); var condition = "com_id in (select comid from agent_warrant where agentid = " + Agentid + " and comid = " + bindingcomid + " and warrant_state=1) and server_type in (1,11,14,9,10) and pro_state=1 "; condition = condition + " and not source_type in (4)";//导入产品,不能再次导入 if (Warrant_type == 2) { condition = condition + " and not source_type in (3) and server_type !=11";//倒码产品不能让倒码分销商导入 ,倒码分销不能导入实物产品 } if (Agentlevel != 0) {//判断分销,根据分销级别,判断这个级别分销价格为0则不显示 if (Agentlevel == 1) { condition = condition + " and ( agent1_price>0 or id in (select proid from b2b_com_pro_Speci where speci_agent1_price>0) ) ";//1级分销不能=0 } if (Agentlevel == 2) { condition = condition + " and ( agent2_price>0 or id in (select proid from b2b_com_pro_Speci where speci_agent2_price>0) )";//2级分销不能=0 } if (Agentlevel == 3) { condition = condition + " and ( agent3_price>0 or id in (select proid from b2b_com_pro_Speci where speci_agent3_price>0) )";//3级分销不能=0 } } if (Key != "") { condition = condition + " and pro_name like '%" + Key + "%'";//3级分销不能=0 } //产品新增加显示设置 1.全部2分销3微信4.官网5.微信和官网 condition += " and (viewmethod in (1,2) or id in (select proid from b2b_agent_prowarrant where Agentid=" + Agentid + " and comid=" + comid + ")) and not id in(select bindingid from b2b_com_pro where com_id = " + comid + ")"; var cmd = sqlHelper.PrepareStoredSqlCommand("proc_ListPage"); cmd.PagingCommand1("b2b_com_pro", "*", "id desc ", "", Pagesize, Pageindex, "", condition); List <B2b_com_pro> list = new List <B2b_com_pro>(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { list.Add(new B2b_com_pro { Id = reader.GetValue <int>("id"), Com_id = reader.GetValue <int>("com_id"), Pro_name = reader.GetValue <string>("pro_name"), Pro_state = reader.GetValue <int>("pro_state"), Server_type = reader.GetValue <int>("server_type"), Pro_type = reader.GetValue <int>("pro_type"), Source_type = reader.GetValue <int>("Source_type"), Pro_Remark = reader.GetValue <string>("pro_Remark"), Pro_start = reader.GetValue <DateTime>("pro_start"), Pro_end = reader.GetValue <DateTime>("pro_end"), Face_price = reader.GetValue <decimal>("face_price"), Advise_price = reader.GetValue <decimal>("advise_price"), Agentsettle_price = reader.GetValue <decimal>("agentsettle_price"), Agent1_price = reader.GetValue <decimal>("Agent1_price"), Agent2_price = reader.GetValue <decimal>("Agent2_price"), Agent3_price = reader.GetValue <decimal>("Agent3_price"), ThatDay_can = reader.GetValue <int>("ThatDay_can"), Thatday_can_day = reader.GetValue <int>("Thatday_can_day"), Service_Contain = reader.GetValue <string>("service_Contain"), Service_NotContain = reader.GetValue <string>("service_NotContain"), Precautions = reader.GetValue <string>("Precautions"), Tuan_pro = reader.GetValue <int>("tuan_pro"), Zhixiao = reader.GetValue <int>("zhixiao"), Agentsale = reader.GetValue <int>("agentsale"), Createtime = reader.GetValue <DateTime>("createtime"), Createuserid = reader.GetValue <int>("createuserid"), Projectid = reader.GetValue <int>("Projectid"), Imgurl = reader.GetValue <int>("imgurl"), ProValidateMethod = reader.GetValue <string>("ProValidateMethod"), Appointdata = reader.GetValue <int>("Appointdata"), Iscanuseonsameday = reader.GetValue <int>("Iscanuseonsameday"), Pro_youxiaoqi = prodata.GetPro_Youxiaoqi(reader.GetValue <DateTime>("pro_start"), reader.GetValue <DateTime>("pro_end"), reader.GetValue <string>("ProValidateMethod"), reader.GetValue <int>("Appointdata"), reader.GetValue <int>("Iscanuseonsameday")) }); } } totalcount = int.Parse(cmd.Parameters[0].Value.ToString()); return(list); }
internal List <B2b_com_pro> UnWarrantProlist(int Pageindex, int Pagesize, string Key, int Agentid, int Warrant_type, int comid, out int totalcount, int Agentlevel = 0, int projectid = 0, string viewmethod = "") { B2bComProData prodata = new B2bComProData(); var condition = "com_id in (select id from b2b_company where id = " + comid + " and lp=1) and server_type in (1,2,8,10,11) and pro_state=1 and convert(varchar(10),pro_end,120)>='" + DateTime.Now.ToString("yyyy-MM-dd") + "'"; if (Agentlevel != 0) {//判断分销,根据分销级别,判断这个级别分销价格为0则不显示 if (Agentlevel == 1) { condition = condition + " and ( agent1_price>0 or server_type in (2,8))";//1级分销不能=0 } if (Agentlevel == 2) { condition = condition + " and ( agent2_price>0 or server_type in (2,8))";//2级分销不能=0 } if (Agentlevel == 3) { condition = condition + " and ( agent3_price>0 or server_type in (2,8))";//3级分销不能=0 } } if (Key != "") { condition = condition + " and pro_name like '%" + Key + "%'";//3级分销不能=0 } //产品新增加显示设置 1.全部2分销3微信4.官网5.微信和官网 if (viewmethod != "") { condition += " and viewmethod in (1,2)"; } //查询指定项目 if (projectid != 0) { condition += " and projectid =" + projectid; } var cmd = sqlHelper.PrepareStoredSqlCommand("proc_ListPage"); cmd.PagingCommand1("b2b_com_pro", "*", "id desc ", "", Pagesize, Pageindex, "", condition); List <B2b_com_pro> list = new List <B2b_com_pro>(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { list.Add(new B2b_com_pro { Id = reader.GetValue <int>("id"), Com_id = reader.GetValue <int>("com_id"), Pro_name = reader.GetValue <string>("pro_name"), Pro_state = reader.GetValue <int>("pro_state"), Server_type = reader.GetValue <int>("server_type"), Pro_type = reader.GetValue <int>("pro_type"), Source_type = reader.GetValue <int>("Source_type"), Pro_Remark = reader.GetValue <string>("pro_Remark"), Pro_start = reader.GetValue <DateTime>("pro_start"), Pro_end = reader.GetValue <DateTime>("pro_end"), Face_price = reader.GetValue <decimal>("face_price"), Advise_price = reader.GetValue <decimal>("advise_price"), Agentsettle_price = reader.GetValue <decimal>("agentsettle_price"), Agent1_price = reader.GetValue <decimal>("Agent1_price"), Agent2_price = reader.GetValue <decimal>("Agent2_price"), Agent3_price = reader.GetValue <decimal>("Agent3_price"), ThatDay_can = reader.GetValue <int>("ThatDay_can"), Thatday_can_day = reader.GetValue <int>("Thatday_can_day"), Service_Contain = reader.GetValue <string>("service_Contain"), Service_NotContain = reader.GetValue <string>("service_NotContain"), Precautions = reader.GetValue <string>("Precautions"), Tuan_pro = reader.GetValue <int>("tuan_pro"), Zhixiao = reader.GetValue <int>("zhixiao"), Agentsale = reader.GetValue <int>("agentsale"), Createtime = reader.GetValue <DateTime>("createtime"), Createuserid = reader.GetValue <int>("createuserid"), Projectid = reader.GetValue <int>("Projectid"), Imgurl = reader.GetValue <int>("imgurl"), ProValidateMethod = reader.GetValue <string>("ProValidateMethod"), Appointdata = reader.GetValue <int>("Appointdata"), Iscanuseonsameday = reader.GetValue <int>("Iscanuseonsameday"), Pro_youxiaoqi = prodata.GetPro_Youxiaoqi(reader.GetValue <DateTime>("pro_start"), reader.GetValue <DateTime>("pro_end"), reader.GetValue <string>("ProValidateMethod"), reader.GetValue <int>("Appointdata"), reader.GetValue <int>("Iscanuseonsameday")), Pro_explain = reader.GetValue <string>("Pro_explain"), Ispanicbuy = reader.GetValue <int>("ispanicbuy"), }); } } totalcount = int.Parse(cmd.Parameters[0].Value.ToString()); return(list); }