public ActionResult Init() { //if (Session[CHubConstValues.SessionUser] == null) // return RedirectToAction("Login", "Account"); using (CHubEntities db = new CHubEntities()) { string appUser = Session[CHubConstValues.SessionUser].ToString(); //add recent page data APP_RECENT_PAGES_BLL rpBLL = new APP_RECENT_PAGES_BLL(db); rpBLL.Add(appUser, PageNameEnum.qkord.ToString(), this.Request.Url.AbsoluteUri); APP_CUST_ALIAS_BLL acaBLL = new APP_CUST_ALIAS_BLL(db); List <ExAppCustAlias> acaList = acaBLL.GetAppCustAliasByAppUser(appUser); APP_ORDER_TYPE_BLL aotBLL = new APP_ORDER_TYPE_BLL(db); List <APP_ORDER_TYPE> aotList = aotBLL.GetValidOrderType(); foreach (var item in aotList) { item.TS_OR_HEADER = null; } var obj = new { custAlias = acaList, orderType = aotList, defaultOrderType = CHubConstValues.DefaultOrderType }; return(Json(obj)); } }
public ActionResult SearchAddrs(string shipName, string addr, string aliasName, bool isSpecialShip, string destName, long?destLocation) { try { List <ExVAliasAddr> list = new List <ExVAliasAddr>(); CHubEntities db = new CHubEntities(); if (isSpecialShip) { V_ALIAS_ADDR_SPL_BLL bll = new V_ALIAS_ADDR_SPL_BLL(); list = bll.GetAliasAddrSPL(shipName.Trim(), addr.Trim(), destName.Trim(), destLocation, aliasName); } else { V_ALIAS_ADDR_DFLT_BLL bll = new V_ALIAS_ADDR_DFLT_BLL(); list = bll.GetAliasAddrDFLT(aliasName); } //Get from parameter table*** if (list.Count > 20) { return(Json(new RequestResult(false, string.Format("Result has {0} items, Make Condition more strict", list.Count.ToString())))); } if (list.Count == 0) { return(Json(new RequestResult(false, "No result"))); } return(Json(new RequestResult(list))); } catch (Exception ee) { return(Json(new RequestResult(false, ee.Message))); } }
private bool SaveMPart(M_PART mPart) { using (CHubEntities db = new CHubEntities()) { M_PART_BLL mPartBLL = new M_PART_BLL(); if (mPartBLL.Exist(mPart.PART_NO)) { //must exist in m_part otherwise error if (mPart != null && !string.IsNullOrEmpty(mPart.TC_CATEGORY_BY_MAN)) { M_PART currMpart = mPartBLL.GetMPartByPartNo(mPart.PART_NO); currMpart.TC_CATEGORY_BY_MAN = mPart.TC_CATEGORY_BY_MAN; mPartBLL.Update(currMpart); } return(true); } else { //error part LogHelper.WriteErrorLog(string.Format("Fail Save Action, reason: Wrong partNo {0}", mPart.PART_NO)); return(false); } } }
private string GetPartNoFromCustPartNo(string custPartNo, string customerNo) { if (string.IsNullOrEmpty(custPartNo)) { return(string.Empty); } using (CHubEntities db = new CHubEntities()) { G_CATALOG_CUSTOMER_PART_BLL custBLL = new G_CATALOG_CUSTOMER_PART_BLL(db); string PartNo = custBLL.GetPartNoFromCustPartNo(custPartNo, customerNo); if (string.IsNullOrEmpty(PartNo)) { G_PART_DESCRIPTION_BLL partBLL = new G_PART_DESCRIPTION_BLL(db); if (partBLL.IsPartNoExist(custPartNo)) { return(custPartNo); } else { return(string.Empty); } } return(PartNo); } }
public ActionResult GetInvSnapShotData(string partNo) { try { using (CHubEntities db = new CHubEntities()) { V_INV_PDC_BLL pdcBLL = new V_INV_PDC_BLL(db); List <V_INV_PDC> pdcList = pdcBLL.GetPDCData(partNo); V_INV_RDC_BLL rdcBLL = new V_INV_RDC_BLL(db); List <V_INV_RDC> rdcList = rdcBLL.GetRDCData(partNo); M_INV_BLL miBLL = new M_INV_BLL(); List <M_INV> interPDCList = miBLL.GetInterPDCData(partNo); var obj = new { pdcList = pdcList, rdcList = rdcList, interPDCList = interPDCList }; return(Json(new RequestResult(obj))); } } catch (Exception ex) { LogHelper.WriteLog("GetSnapShot", ex); return(Json(new RequestResult(false, ex.Message))); } }
public bool SaveTCPartData(TC_PART_HS partHS, M_PART mPart) { using (CHubEntities db = new CHubEntities()) { M_PART_BLL mPartBLL = new M_PART_BLL(); if (mPartBLL.Exist(partHS.PART_NO)) { //must exist in m_part otherwise error if (mPart != null && !string.IsNullOrEmpty(mPart.TC_CATEGORY_BY_MAN)) { M_PART currMpart = mPartBLL.GetMPartByPartNo(partHS.PART_NO); currMpart.TC_CATEGORY_BY_MAN = mPart.TC_CATEGORY_BY_MAN; mPartBLL.Update(currMpart); } if (partHS != null) { TC_PART_HS_BLL pHSBLL = new TC_PART_HS_BLL(db); if (pHSBLL.Exist(partHS.PART_NO)) { //update TC_PART_HS existModel = pHSBLL.GetTCPartHS(partHS.PART_NO); List <string> skipList = new List <string>(); skipList.Add("PART_NO"); skipList.Add("CREATED_BY"); skipList.Add("CREATE_DATE"); skipList.Add("UPDATED_BY"); skipList.Add("RECORD_DATE"); ClassConvert.DrawObj(partHS, existModel, skipList); existModel.UPDATED_BY = Session[CHubConstValues.SessionUser].ToString(); existModel.RECORD_DATE = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); pHSBLL.update(existModel, false); } else { //add partHS.CREATED_BY = Session[CHubConstValues.SessionUser].ToString(); partHS.CREATE_DATE = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); partHS.UPDATED_BY = Session[CHubConstValues.SessionUser].ToString(); partHS.RECORD_DATE = partHS.CREATE_DATE; pHSBLL.Add(partHS, false); } } db.SaveChanges(); return(true); } else { //error part LogHelper.WriteErrorLog(string.Format("Fail Save Action, reason: Wrong partNo {0}", partHS.PART_NO)); return(false); } } }
public ActionResult InitDraft() { //if (Session[CHubConstValues.SessionUser] == null) // return RedirectToAction("Login", "Account"); string appUser = Session[CHubConstValues.SessionUser].ToString(); CHubEntities db = new CHubEntities(); TS_OR_HEADER_STAGE_BLL hStageBLL = new TS_OR_HEADER_STAGE_BLL(); List <TS_OR_HEADER_STAGE> hStageList = hStageBLL.GetHeaderStageByUser(appUser); return(Json(hStageList)); }
public ActionResult QueryAction(string partNo, string hsCode, string declrName, string element, int currentPage, int pageSize) { CHubEntities db = new CHubEntities(); V_TC_MDM_ALL_BLL mdmBLL = new V_TC_MDM_ALL_BLL(db); int totalCount = 0; List <V_TC_MDM_ALL> result = mdmBLL.GetTCMDMList(partNo, hsCode, declrName, element, currentPage, pageSize, out totalCount); var obj = new { result = result, totalCount = totalCount }; return(Json(obj)); }
public ActionResult DeleteDraft(decimal orderSeq, decimal shipFrom) { try { CHubEntities db = new CHubEntities(); TS_OR_HEADER_STAGE_BLL hStageBLL = new TS_OR_HEADER_STAGE_BLL(); hStageBLL.DeleteDraft(orderSeq, shipFrom); return(Content("Success")); } catch (Exception ee) { Response.StatusCode = (int)HttpStatusCode.InternalServerError; return(Content(ee.Message)); } }
public ActionResult DownLoadOrder(decimal?orderSeq, decimal shipFrom = 0) { try { StringBuilder sb = new StringBuilder(); if (orderSeq == null || orderSeq == 0) { Response.StatusCode = (int)HttpStatusCode.BadRequest; return(Content("No order seq data")); } CHubEntities db = new CHubEntities(); V_O_DOWNLOAD_HDR_BLL hBLL = new V_O_DOWNLOAD_HDR_BLL(db); V_O_DOWNLOAD_HDR hData = hBLL.GetSpecfyHDRData(orderSeq.Value, shipFrom); if (hData == null) { throw new Exception("No Header Data"); } V_O_DOWNLOAD_DTL_BLL dBLL = new V_O_DOWNLOAD_DTL_BLL(db); List <V_O_DOWNLOAD_DTL> dList = dBLL.GetDTLList(orderSeq.Value, shipFrom); if (dList == null || dList.Count == 0) { throw new Exception("No Lines Data"); } sb.AppendLine(hData.TXT); foreach (var item in dList) { sb.AppendLine(item.TXT); } byte[] buffer = Encoding.UTF8.GetBytes(sb.ToString()); return(File(buffer, "text/csv", hData.FILE_NAME)); } catch (Exception ee) { Response.StatusCode = (int)HttpStatusCode.BadRequest; return(Content(ee.Message)); } }
public ActionResult QueryAction(decimal?orderSeq, string custAlias, string poNum, int currentPage, int pageSize) { if (Session[CHubConstValues.SessionUser] == null) { return(RedirectToAction("Login", "Account")); } int totalCount = 0; CHubEntities db = new CHubEntities(); TS_OR_HEADER_BLL hBLL = new TS_OR_HEADER_BLL(db); List <TS_OR_HEADER> result = hBLL.GetHeaders(orderSeq, custAlias, poNum, currentPage, pageSize, out totalCount); var obj = new { result = result, totalCount = totalCount }; return(Json(obj)); }
public ActionResult GetStrictAddrs(string shipName, string addr, string aliasName, bool isSpecialShip) { try { List <ExVAliasAddr> list = new List <ExVAliasAddr>(); CHubEntities db = new CHubEntities(); if (isSpecialShip) { V_ALIAS_ADDR_SPL_BLL bll = new V_ALIAS_ADDR_SPL_BLL(); list = bll.GetStrictAliasAddrSPL(shipName.Trim(), addr.Trim(), aliasName); } else { V_ALIAS_ADDR_DFLT_BLL bll = new V_ALIAS_ADDR_DFLT_BLL(); list = bll.GetStrictAliasAddrDFLT(shipName.Trim(), addr.Trim(), aliasName); } return(Json(list)); } catch (Exception ee) { Response.StatusCode = (int)HttpStatusCode.InternalServerError; return(Content(ee.Message)); } }
public V_ITT_SHIPPING_ALLIN1_DAL(CHubEntities db) : base(db) { }
public TC_PART_HS_AUDIT_BLL(CHubEntities db) { dal = new TC_PART_HS_AUDIT_DAL(db); }
public V_RP_PACK_D_BASE_BLL(CHubEntities db) { dal = new V_RP_PACK_D_BASE_DAL(db); }
public V_USER_NAV_ALL_BLL(CHubEntities db) { dal = new V_USER_NAV_ALL_DAL(db); }
public RP_WAYBILL_BASICINFO_DAL(CHubEntities db) : base(db) { }
public RP_PRINTER_BLL(CHubEntities db) { dal = new RP_PRINTER_DAL(db); }
public RP_CUST_PACK_TYPE_DAL(CHubEntities db) : base(db) { }
public RP_LABEL_TYPE_BLL(CHubEntities db) { dal = new RP_LABEL_TYPE_DAL(db); }
public ITT_TRAN_TYPE_DAL(CHubEntities db) : base(db) { }
public V_OPEN_QTY_PO_RDC_DAL(CHubEntities db) : base(db) { }
public ITT_SHIPPING_D_SNAP_DAL(CHubEntities db) : base(db) { }
public EW_MESSAGE_BLL(CHubEntities db) { dal = new EW_MESSAGE_DAL(db); }
public V_SHIPMENT_H_RP_ALL_BLL(CHubEntities db) { dal = new V_SHIPMENT_H_RP_ALL_DAL(db); }
public M_APPS_BLL(CHubEntities db) { dal = new M_APPS_DAL(db); }
public ITT_SHIPPING_H_BLL(CHubEntities db) { dal = new ITT_SHIPPING_H_DAL(db); }
public V_TC_MDM_ALL_BLL(CHubEntities db) { dal = new V_TC_MDM_ALL_DAL(db); }
public RP_WAYBILL_TYPE_DAL(CHubEntities db) : base(db) { }
public RP_STATION_BLL(CHubEntities db) { dal = new RP_STATION_DAL(db); }