public JsonResult SaveLine(string id, string xxcode, string xxname) { JsonData d = new JsonData(); Sys_XxType sb = new Sys_XxType(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.xxname = xxname; sb.xxcode = xxcode; sb.cdate = DateTime.Now.ToString(); if (id == "0") { if (salb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { sb.id = Convert.ToInt32(id); if (salb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveSysMenuCode(string sccode, string scid, string scname, string scremark, string sctype) { JsonData d = new JsonData(); Sys_SysMenuCode sa = new Sys_SysMenuCode(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sa.scode = sccode; sa.sname = scname; sa.stype = sctype; sa.sremark = scremark; if (scid == "0") { if (stmb.Add(sa) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (stmb.Update(sa)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public static ArrayList QueryList() { ArrayList r = new ArrayList(); List <Sys_Package> lsf = new List <Sys_Package>(); SqlCondtion sc = new SqlCondtion(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); StringBuilder where = new StringBuilder(); if (iv.u.rcode != "xtgl") { where.Append(" and dcode='" + iv.u.dcode.Substring(0, 8) + "'"); } lsf = spb.QueryList(""); if (lsf != null) { foreach (Sys_Package s in lsf) { ArrayList al = new ArrayList(); al.Add(s.pcode); al.Add(s.pname); al.Add(s.basenum); al.Add(s.zjtype); al.Add(s.istz); al.Add(s.tznum); al.Add(s.psort); al.Add(s.maxnum); al.Add(s.hlvalue + "-" + s.htvalue); al.Add(s.klvalue + "-" + s.ktvalue); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public JsonResult SaveBrand(string id, string pccode, string pcname) { JsonData d = new JsonData(); Sys_Brands sb = new Sys_Brands(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.pbcode = pccode; sb.pbname = pcname; sb.maker = iv.u.ename; sb.cdate = DateTime.Now.ToString(); if (id == "0") { if (sbb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (sbb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public static ArrayList QueryAttachmentList(string sid, string gsid, string ftype) { ArrayList r = new ArrayList(); StringBuilder where = new StringBuilder(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add("S"); if (ftype != "") { where.AppendFormat(" and ftype='{0}'", ftype); } if (gsid != "") { where.AppendFormat(" and gsid='{0}'", gsid); } if (sid != "") { where.AppendFormat(" and sid='{0}'", sid); } List <B_Attachment> lbsp = bahb.QueryList(where.ToString()); if (lbsp != null) { foreach (B_Attachment b in lbsp) { ArrayList al = new ArrayList(); al.Add(b.id); al.Add(b.fname); al.Add("<button id='" + b.id + "' onclick=\"DownFile(this.id,'','a')\">下载</button>"); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public static string QueryOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_GlassOrder bco = bsob.Query(" and sid='" + sid + "'"); if (bco != null) { CB_ProduceStartDate csd = cpsdb.Query(" and sid='" + sid + "'"); bco.ddate = csd != null? csd.sdate:""; r = js.Serialize(bco); } } else { r = iv.badstr; } return(r); }
public static string HtProductionPriceDetail(string sid, string ttype) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { StringBuilder invhtm = new StringBuilder(); #region//加载表体 invhtm.Append(bpigptb.QueryHtTableBody(sid, ttype)); #endregion invhtm.Append(bpigptb.QueryHtTableFoot(sid, ttype)); r = invhtm.ToString(); } else { r = iv.badstr; } return(r); }
public static string Query(string eno) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Designer sd = sdb.Query(" and eno='" + eno + "'"); List <Sys_DesignerProduction> lsp = sdpb.QueryList(" and eno='" + eno + "' order by id"); if (lsp != null) { sd.sdp = lsp; } r = js.Serialize(sd); } else { r = iv.badstr; } return(r); }
public static ArrayList QuerySearchOrder(string stype, string sstr) { ArrayList r = new ArrayList(); SessionUserValidate iv = SysValidateBll.ValidateSession(); DataTable lsr = new DataTable(); StringBuilder where = new StringBuilder(); if (iv.f) { r.Add(iv.badstr); string stable = ""; string sfield = " sid,scode,city,dname,customer,telephone,address"; if (sstr != "") { where.AppendFormat(" and ifactorydeliver>0 and (customer like '%{0}%' or scode like '%{0}%' or city like '%{0}%' or dname like '%{0}%' or telephone like '%{0}%')", sstr); } if (stype == "mm") { stable = "View_B_YqSaleOrder"; } DataTable dt = tsb.QueryList(stable, sfield, where.ToString(), " order by id desc"); if (dt != null) { foreach (DataRow dr in dt.Rows) { ArrayList al = new ArrayList(); foreach (DataColumn column in dt.Columns) { al.Add(dr[column].ToString()); } r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public JsonResult UpdateFixOrderMoney(string sid, string amoney, string dmoney, string mremark, List <String[]> prow) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { ArrayList pml = new ArrayList(); B_FixMoney bfm = new B_FixMoney(); bfm.amoney = Convert.ToDecimal(amoney); bfm.dmoney = 0 - Convert.ToDecimal(dmoney); bfm.sid = sid; bfm.premark = mremark; bfm.cdate = DateTime.Now.ToString(); bfm.maker = iv.u.ename; if (prow != null) { foreach (String[] s in prow) { ArrayList al = new ArrayList(); al.Add(s[0]); al.Add(s[2]); pml.Add(al); } } if (bfmb.UpdateFixMoney(bfm, pml)) { d.d = "S"; } else { d.d = "F"; } } else { d.d = iv.badstr; } return(Json(d)); }
public static string SetAssort(string pcode, string ptpcode) { string r = ""; Sys_AssortBll srb = new Sys_AssortBll(); Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { srb.DelAssort(pcode); string[] arr = ptpcode.Split(';'); try { foreach (string pv in arr) { ArrayList ls = new ArrayList(); List <Sys_InventoryCategory> lsic = sicb.QueryList(" and iccode like '" + pv + "%' order by id asc"); if (lsic != null) { foreach (Sys_InventoryCategory sic in lsic) { ls.Add(sic.iccode); } } srb.SetAssort(pcode, pv, ls); } r = "S"; } catch { r = "F"; srb.DelAssort(pcode); } } else { r = iv.badstr; } return(r); }
public JsonResult SaveDataTable(string id, string sname, string stable) { JsonData d = new JsonData(); Sys_DataTable sa = new Sys_DataTable(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sa.sname = sname; sa.stable = stable; if (id == "0") { if (sdtb.Add(sa) > 0) { d.d = "S"; } else { d.d = "F"; } } else { sa.id = Convert.ToInt32(id); if (sdtb.Update(sa)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveProduceCate(string lcode, string lname, string lid) { JsonData d = new JsonData(); Sys_ProduceCate sb = new Sys_ProduceCate(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.lcode = lcode; sb.lname = lname; sb.cdate = DateTime.Now.ToString(); if (lid == "0") { if (spcb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (spcb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public static ArrayList EditProductionCgPrice(string sid, string gnum) { ArrayList r = new ArrayList(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); List <B_GroupProduction> lb = bgpb.QueryList(" and sid='" + sid + "' and gnum=" + gnum + " order by id"); if (lb != null) { foreach (B_GroupProduction g in lb) { ArrayList al = new ArrayList(); decimal inum = bgpb.CgProductionNum(g); al.Add(g.psid); al.Add(g.iname); if (g.ichange == 0) { al.Add(bgpb.CgProdutionPrice(g)); } else { al.Add(g.cmoney / inum); } al.Add(inum); al.Add(g.covermoney); al.Add(g.cothermoney); al.Add(g.cmoney + g.covermoney + g.cothermoney); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public static string BatchSaveInventoryCategory(string pname, string pcode) { string r = ""; Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { string[] parr = pcode.Split(';'); for (int i = 0; i < parr.Length; i++) { Sys_InventoryCategory sic = new Sys_InventoryCategory(); Sys_InventoryCategory p = sicb.Query(" and iccode='" + parr[i] + "' "); sic.iccode = parr[i] + sicb.CreateCode(parr[i]).ToString().PadLeft(3, '0'); sic.icpcode = parr[i]; sic.icname = pname; sic.icpname = p != null? p.icname:""; sic.maker = iv.u.ename; sic.cdate = DateTime.Now.ToString(); sic.icsend = true; sic.icstate = true; sic.icms = ""; sic.drange = p != null?p.drange:""; if (sicb.Add(sic) > 0) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }
public static ArrayList CustQueryList() { ArrayList r = new ArrayList(); List <Sys_OrderCode> lsr = new List <Sys_OrderCode>(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); string where = ""; if (iv.u.rcode == "xtgl") { } else { where = " and dcode='" + iv.u.dcode.Substring(0, 8) + "'"; } lsr = socb.QueryList(where); if (lsr != null) { foreach (Sys_OrderCode s in lsr) { ArrayList al = new ArrayList(); Sys_EventMenu sem = symb.Query(" and emcode='" + s.emcode + "'"); al.Add(s.ccode); al.Add(s.cname); al.Add(sem == null ? "" : sem.emname); al.Add(s.inum); al.Add(s.years); al.Add(s.prestr); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public static string QueryAfterMoney(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VAOrderPrice vaop = new VAOrderPrice(); StringBuilder omh = new StringBuilder(); B_AfterSaleOrder bafo = abasob.Query("and sid='" + sid + "'"); if (bafo != null) { vaop.omoney = bafo.omoney.ToString("#0.00"); B_AfterPriceFile bapf = abpfb.Query("and sid='" + sid + "'"); if (bapf != null) { vaop.bshow = "1"; vaop.fname = bapf.fname; vaop.pfid = bapf.id.ToString(); } List <B_PayImg> lobpi = bpib.QueryList(" and sid='" + sid + "' and ptype='o'"); if (lobpi != null) { omh.Append("<table style='width:100%;border:none'>"); foreach (B_PayImg bpi in lobpi) { omh.AppendFormat("<tr><td><img id='{0}' src='{1}' alt='' onclick='nck(this.id)'/></td></tr>", bpi.id, bpi.url); } omh.Append("<table>"); } vaop.ohtm = omh.ToString(); r = js.Serialize(vaop); } } else { r = iv.badstr; } return(r); }
public static string SetDiscount(string sid, string dv) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r = "F"; B_SaleOrder bso = bsob.Query(" and sid='" + sid + "'"); if (bso != null) { if (bsob.SetGDiscount(sid, Convert.ToDecimal(dv))) { r = "S"; } } B_YqSaleOrder ybso = ybsob.Query(" and sid='" + sid + "'"); if (ybso != null) { if (ybsob.SetGDiscount(sid, Convert.ToDecimal(dv))) { r = "S"; } } B_AfterSaleOrder baso = basob.Query(" and sid='" + sid + "'"); if (bso != null) { r = "S"; //if (basob.SetGDiscount(sid, Convert.ToDecimal(dv))) //{ //} } } else { r = iv.badstr; } return(r); }
public JsonResult CustQueryTabMenuList(string agr) { JsonData d = new JsonData(); ArrayList r = new ArrayList(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); string where = ""; if (agr == "1") { where = " and isflow='true'"; } if (iv.u.rcode == "xtgl") { } else { where = where + " and (tread='true' or dcode='" + iv.u.dcode.Substring(0, 8) + "')"; } List <Sys_TabMenu> ls = stmb.QueryList(where); if (ls != null) { foreach (Sys_TabMenu sw in ls) { ArrayList al = new ArrayList(); al.Add(sw.tmcode); al.Add(sw.tmname); r.Add(al); } } } else { r.Add(iv.badstr); } d.d = js.Serialize(r); return(Json(d)); }
public JsonResult QueryList(string gcode) { JsonData d = new JsonData(); ArrayList r = new ArrayList(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); string where = ""; if (iv.u.rcode != "xtgl") { where = " and dcode = '" + iv.u.dcode.Substring(0, 8) + "'and gcode='" + gcode + "'"; } else { where = " and gcode='" + gcode + "'"; } List <Sys_ProductionProcessCost> ls = sppcb.QueryList(where); if (ls != null) { foreach (Sys_ProductionProcessCost sw in ls) { ArrayList al = new ArrayList(); al.Add(sw.ucode); al.Add(sw.uname); al.Add(sw.gname); al.Add(sw.mname); al.Add(sw.unum); r.Add(al); } } } else { r.Add(iv.badstr); } d.d = js.Serialize(r); return(Json(d)); }
public static string SaveInHouseRecord(string ibz, string icode, string idate, string inum, string iperson, string itype, string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_InHouseRecord bihr = new B_InHouseRecord(); bihr.bnum = Convert.ToInt32(inum); bihr.ccode = icode; bihr.cdate = DateTime.Now.ToString(); bihr.maker = iv.u.ename; bihr.rdate = idate; bihr.remarke = ibz; bihr.rperson = iperson; bihr.sid = sid; if (bohrb.Add(bihr) > 0) { r = "S"; if (itype == "1") { cbsb.UpState(sid, "istoreget", 1); } if (itype == "2") { cbsb.UpState(sid, "istoreget", 2); cbsb.UpState(sid, "ifactorydeliver", 2); } } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static ArrayList QueryListFyRole(string curpage, string pagesize) { ArrayList r = new ArrayList(); Sys_RoleBll sdb = new Sys_RoleBll(); List <Sys_Role> lsr = new List <Sys_Role>(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { string where = ""; r.Add(iv.badstr); int rcount = 0; int pcount = 0; if (iv.u.rcode == "xtgl") { } else { where = " and dcode='" + iv.u.dcode.Substring(0, 8) + "'"; } lsr = sdb.QueryList(Convert.ToInt32(curpage), Convert.ToInt32(pagesize), where, "id desc", ref rcount, ref pcount); if (lsr != null) { r.Add(pcount); foreach (Sys_Role s in lsr) { ArrayList al = new ArrayList(); al.Add(s.rcode); al.Add(s.rname); al.Add(s.rdetail); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public static ArrayList QueryPlanProductionNum(string sid) { ArrayList r = new ArrayList(); DataTable lsr = new DataTable(); StringBuilder where = new StringBuilder(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); int msn = 0; int mtn = 0; int qtn = 0; string[] sids = sid.Split(';'); foreach (string str in sids) { msn = msn + bpib.TjItemNum(str, "f,s"); } foreach (string str in sids) { mtn = mtn + (int)bgpb.TjProductionQtNum(" and sid='" + str + "' and (substring(icode,9,3)='002' or substring(icode,9,3)='006')"); } foreach (string str in sids) { qtn = qtn + (int)bgpb.TjProductionQtNum(" and sid='" + str + "' and substring(icode,9,3)<>'002' and substring(icode,9,3)<>'006' and substring(icode,9,3)<>'001' and substring(icode,9,3)<>'004'and substring(icode,9,3)<>'005'and substring(icode,9,3)<>'0011'"); } r.Add(msn); r.Add(mtn); r.Add(qtn); } else { r.Add(iv.badstr); r.Add(0); r.Add(0); r.Add(0); } return(r); }
public JsonResult ReSetSmProductin(string icode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (sppb.ReSetPriceBl(icode) > 0) { d.d = "S"; } else { d.d = "F"; } } else { d.d = iv.badstr; } return(Json(d)); }
public static string ReSetInvCom(string icode) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (sccb.ReSetInvComCate(icode) > 0) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string DelCom(string ccode) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (scb.Delete(ccode)) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static ArrayList QueryByTypeList(string ctype) { ArrayList r = new ArrayList(); Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll(); List <Sys_ComputeFunction> lsf = new List <Sys_ComputeFunction>(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); string where = ""; if (iv.u.rcode != "xtgl") { where = " and fattr='" + ctype + "' and dcode ='" + iv.u.dcode.Substring(0, 8) + "'"; } else { where = " and fattr='" + ctype + "'"; } lsf = srb.QueryList(where); if (lsf != null) { foreach (Sys_ComputeFunction s in lsf) { ArrayList al = new ArrayList(); al.Add(s.fcode); al.Add(s.fname); al.Add(s.fattr); al.Add(s.fstr); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public JsonResult ReSetPeriod(string icode, string fcode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (sltb.ReSetPeriod(icode, fcode)) { d.d = "S"; } else { d.d = "F"; } } else { d.d = iv.badstr; } return(Json(d)); }
public static string Setlments(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (cbsb.UpState(sid, "isetlment", 2) > 0) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public JsonResult ReSetDepDiscount(string dcode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (ssdb.ReSetDepDiscount(dcode) > 0) { d.d = "S"; } else { d.d = "F"; } } else { d.d = iv.badstr; } return(Json(d)); }