public ActionResult DeliveryOrderList() { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Delivery/DeliveryOrderList - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Delivery/DeliveryOrderList"); int count = Convert.ToInt32(Math.Ceiling((Double)((Double)orderTableDao.CountOrder(ORDERCODE, CompanySession.CompanyCode, false) / (Double)PAGELIMIT))); IList <OrderTable> list = orderTableDao.SelectOrder(PAGELIMIT, Define.PAGE_START, ORDERCODE, CompanySession.CompanyCode, false); String idxcollection = ""; LanguageType?lType = GetLanguageType(); foreach (OrderTable pBuffer in list) { pBuffer.StateView(lType); idxcollection += pBuffer.Idx.ToString() + ","; } ViewBag.list = list; ViewBag.listcount = count; ViewBag.idxCollection = idxcollection; return(View("~/Views/Delivery/Web/DeliveryOrderList.cshtml", Define.MASTER_VIEW)); }
public ActionResult StoreListSearch(int page = 0) { if (!SessionCheck(Define.Session.AJAX_CHECK)) { return(Content("NG")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/StoreListSearch - NoAjax"); return(NoAjax()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/StoreListSearch"); if (page < 1) { page = 1; } int count = cargoDao.GetCargoListCount(CompanySession.CompanyCode); LanguageType? lType = GetLanguageType(); IList <Cargo> list = cargoDao.SelectCargoList(PAGELIMIT, page, CompanySession.CompanyCode); Dictionary <String, object> pRet = new Dictionary <String, object>(); for (int i = 0; i < list.Count; i++) { list[i].TypeCheck(lType); pRet.Add("item" + i.ToString(), list[i]); } pRet.Add("count", list.Count); pRet.Add("totalcount", count); pRet.Add("limit", PAGELIMIT); return(Json(pRet, JsonRequestBehavior.AllowGet)); }
public ActionResult DeliveryView(Int64 idx) { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Delivery/DeliveryCheckList - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Delivery/DeliveryView"); LanguageType?lType = GetLanguageType(); DeliveryTable delivery = deliveryTableDao.SelectByIdx(idx, CompanySession.CompanyCode); IList <DeliveryTableSub> sub = deliveryTableSubDao.SelectSubList(idx, CompanySession.CompanyCode, lType); Document doc = documentDao.SelectDocument(idx, DOCUMENTDELIVERYCODE, CompanySession.CompanyCode); Decimal total = 0; Decimal taxtotal = 0; foreach (DeliveryTableSub pData in sub) { total += pData.ProductPrice; taxtotal += pData.ProductVat; } ViewBag.delivery = delivery; ViewBag.deliverySub = sub; ViewBag.document = doc; ViewBag.total = total; ViewBag.taxtotal = taxtotal; Session[Define.Session.ACTION] = "DeliveryCheckList"; return(View("~/Views/Delivery/Web/DeliveryView.cshtml", Define.MASTER_VIEW)); }
/// <summary> /// 翻译文本 /// </summary> /// <param name="OriginalText">原文</param> /// <param name="langType">翻译语种</param> /// <returns></returns> public string L(string OriginalText, LanguageType?langType = null) { var theLangType = langType.HasValue ? langType.Value : BoBConfiguration.BaseLangType; var LangDics = _cacheService.Get <Dictionary <string, string> >(CacheTag.BoBLangService, theLangType.ToString(), () => { var rootPath = PathHelper.GetAppRootPath(); var filePath = rootPath + BoBConfiguration.LangFolder + theLangType.ToString() + ".json"; if (Directory.Exists(rootPath + BoBConfiguration.LangFolder) && File.Exists(filePath)) { using (StreamReader r = new StreamReader(filePath, Encoding.UTF8)) { string json = r.ReadToEnd(); Dictionary <string, string> items = JsonConvert.DeserializeObject <Dictionary <string, string> >(json); return(items); } } else { return(new Dictionary <string, string>()); } }, 3600); return(LangDics.ContainsKey(OriginalText) ? LangDics[OriginalText] : OriginalText); //如果找不到译文则直接显示原文 }
public IPersonalInfo GetPersonalInfo(string email) { ApplicationUser user = repository.UserManager.FindByEmail(email); LanguageType? userLanguage = user.Language != null?Assembler.Assemble(user.Language.Value) : default(LanguageType?); return(new PersonalInfo(user.FirstName, user.Surname, user.City, user.PostDepartment, user.PhoneNumber, userLanguage)); }
public static List <String> Validate(this ProductFlow entity, LanguageType?lType) { List <String> Errmsg = new List <string>(); if (entity.ProductIndex <= 0) { if (lType == LanguageType.Korea) { Errmsg.Add("상품이 선택되지 않았습니다."); } else { Errmsg.Add("商品が選択されてありません。。"); } } if (entity.ProductAmount <= 0) { if (lType == LanguageType.Korea) { Errmsg.Add("상품수량이 입력되지 않았습니다."); } else { Errmsg.Add("商品数量が入力されてありません。"); } } return(Errmsg); }
protected override ViewResult View(string viewName, string masterName, object model) { String controller = (String)Session[Define.Session.CONTROLLER]; String action = (String)Session[Define.Session.ACTION]; Session[Define.Session.VIEW_NAME] = viewName; LanguageType?lType = GetLanguageType(); Session[Define.Session.LANGUAGE_TYPE] = lType; if (controller != null && action != null) { ViewBag.Disp = new LanguagePack(Server.MapPath("~/Language"), controller, action, lType); } if (Define.MASTER_VIEW.Equals(masterName)) { Session[Define.Session.MASTER] = masterName; ViewBag.Master = new LanguagePack(Server.MapPath("~/Language"), "./", "Master", lType); ViewBag.Navigate = new NavigationPack(Server.MapPath("~/Navigation"), controller, action, lType); } else { Session[Define.Session.MASTER] = null; } Session[Define.Session.SESSION_ID] = SessionIDCreate(); ViewBag.SessionID = Session[Define.Session.SESSION_ID]; return(base.View(viewName, masterName, model)); }
public ActionResult Main() { if (!SessionCheck(Define.Session.SESSION_CHECK)) { LogWriter.Instance().LogWrite("/Board/List 에서 세션 만료로 에러가 발생합니다."); return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Board/CommentApply - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Customer/Main"); LanguageType?lType = GetLanguageType(); ViewBag.customerType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.CUSTOMER_TYPE, lType); ViewBag.moneySendType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.MONEY_SEND_TYPE, lType); ViewBag.customerTaxType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.CUSTOMER_TAX_TYPE, lType); //1페이지 검색 int count = Convert.ToInt32(Math.Ceiling((Double)((Double)customerInfoDao.GetCustomerInfoCount(CompanySession.CompanyCode) / (Double)PAGELIMIT))); ViewBag.list = customerInfoDao.SelectList(PAGELIMIT, Define.PAGE_START, CompanySession.CompanyCode); ViewBag.listcount = count; return(View("~/Views/Customer/Web/Main.cshtml", Define.MASTER_VIEW)); }
public static List <String> Validate(this ProductInfo entity, LanguageType?lType) { List <String> Errmsg = new List <string>(); if (lType == LanguageType.Korea) { if (entity.ProductCode == null || entity.ProductCode.Equals("")) { Errmsg.Add("상품코드가 입력되지 않았습니다."); } if (entity.ProductName == null || entity.ProductName.Equals("")) { Errmsg.Add("상품이름이 입력되지 않았습니다."); } } else { if (entity.ProductCode == null || entity.ProductCode.Equals("")) { Errmsg.Add("商品コードが入力されてありません。"); } if (entity.ProductName == null || entity.ProductName.Equals("")) { Errmsg.Add("商品名が入力されてありません。"); } } return(Errmsg); }
/// <summary> /// validate /// </summary> public List <String> Validate(LanguageType?lType) { List <String> Errmsg = new List <string>(); if (this.m_pList.Count <= 0) { if (lType == LanguageType.Korea) { Errmsg.Add("상품명이 입력되지 않았습니다."); } else { Errmsg.Add("商品名が入力されてありません。"); } } int i = 1; foreach (OrderTableSub pdata in this.m_pList) { List <String> pBuffer = pdata.Validate(lType, i); foreach (String pBuffer2 in pBuffer) { Errmsg.Add(pBuffer2); } i++; } return(Errmsg); }
/// <summary> /// 유저정보 수정 /// Database - CompanyCode Binding OK! /// </summary> public UserInfo ModifyUserInfo(UserInfo entity, LanguageType?lType, String comp) { ParameterInit(); ParameterAdd("idx", entity.Idx); ParameterAdd("companycode", comp); StringBuilder query = new StringBuilder(); query.Append(" UPDATE "); query.Append(" tbl_UserInfo "); query.Append(" set state = 1 "); query.Append(" where companycode = @companycode and idx=@idx"); base.Delete(query.ToString(), GetParameter()); Insert(entity, "tbl_UserInfo"); ParameterInit(); ParameterAdd("idx", ScopeIndentity("tbl_UserInfo")); ParameterAdd("companycode", comp); query.Append(" SELECT "); query.Append(" * "); query.Append(" FROM tbl_UserInfo where idx=@idx and companycode = @companycode "); UserInfo ret = Select(query.ToString(), GetParameter())[0]; ret.NumberJoin(); return(ret); }
public ActionResult ReleaseListSearch(int page = 0) { if (!SessionCheck(Define.Session.AJAX_CHECK)) { return(Content("NG")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseListSearch - NoAjax"); return(NoAjax()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseHistoryListSearch"); LanguageType?lType = GetLanguageType(); if (page < Define.PAGE_START) { page = Define.PAGE_START; } int count = productFlowDao.CountFlowList(CompanySession.CompanyCode, Define.ProductFlow.OUTCOMESTANBY, Define.ProductFlow.OUTPUTCANCEL, Define.ProductFlow.OUTPUTCOMPLATE); IList <ProductFlow> list = productFlowDao.SelectFlowList(PAGELIMIT, page, CompanySession.CompanyCode, Define.ProductFlow.OUTCOMESTANBY, Define.ProductFlow.OUTPUTCANCEL, Define.ProductFlow.OUTPUTCOMPLATE); Dictionary <String, object> pRet = new Dictionary <String, object>(); for (int i = 0; i < list.Count; i++) { list[i].stateView(lType); pRet.Add("item" + i.ToString(), list[i]); } pRet.Add("count", list.Count); pRet.Add("totalcount", count); pRet.Add("limit", PAGELIMIT); return(Json(pRet, JsonRequestBehavior.AllowGet)); }
/* * public Decimal ProductAmount * { * get { return (Decimal)Get("ProductAmount", typeof(Decimal)); } * } * public Decimal ProductAvgPrice * { * get { return (Decimal)Get("ProductAvgPrice", typeof(Decimal)); } * } * public String productname * { * get { return (String)Get("productname", typeof(String)); } * }*/ public void TypeCheck(LanguageType?lType) { if (productinput == 0 && productoutput != 0) { if (Object.Equals(lType, LanguageType.Korea)) { ProductType = "출고"; } else { ProductType = "出庫"; } } else if (productinput != 0 && productoutput == 0) { if (Object.Equals(lType, LanguageType.Korea)) { ProductType = "입고"; } else { ProductType = "入庫"; } } else { ProductType = ""; } }
public static String GetError(String ServerPath, String ErrorCode, LanguageType?pType) { String pStep = ""; String pMsg = ""; bool ErrerOpen = false; XmlTextReader xtr = null; try { xtr = new XmlTextReader(ServerPath); while (xtr.Read()) { switch (xtr.NodeType) { case XmlNodeType.Element: pStep = xtr.Name; if (pStep == "ErrorCode") { if (xtr.GetAttribute("key").Equals("ERR" + ErrorCode)) { ErrerOpen = true; } } break; case XmlNodeType.Text: if (ErrerOpen) { if ((pType == LanguageType.Korea && "korea".Equals(pStep)) || (pType != LanguageType.Korea && "japan".Equals(pStep))) { pMsg = xtr.Value; } } break; case XmlNodeType.EndElement: if (xtr.Name.Equals("ErrorCode") && ErrerOpen) { xtr.Close(); return(pMsg); } break; } } } catch (Exception e) { LogWriter.Instance().LogWrite("LanguagePack Error - " + e.ToString()); } finally { if (xtr != null) { xtr.Close(); } } return(""); }
public ActionResult Order(String key = "") { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Obtain/Order - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Obtain/Order"); LanguageType?lType = GetLanguageType(); //회원정보 ViewBag.userinfo = UserSession; //회사정보 ViewBag.compinfo = CompanySession; ViewBag.moneySendType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.MONEY_SEND_TYPE, lType); ViewBag.ordercomplist = customerInfoDao.SelectByOrderCompList(CompanySession.CompanyCode); ViewBag.productlist = productInfoDao.GetProductNameList(CompanySession.CompanyCode); Document doc = null; OrderTable order = null; if (Object.Equals("BACK", key)) { doc = (Document)Session["orderDOC"]; order = (OrderTable)Session["order"]; IList <OrderTableSub> OrderSubList = (IList <OrderTableSub>)Session["orderSub"]; if (doc == null || order == null) { ViewBag.MunCode = documentDao.CreateCode(); ViewBag.BalCode = orderTableDao.CreateCode(); ViewBag.totalMoney = 0; } else { ViewBag.MunCode = doc.DocumentCode; ViewBag.BalCode = order.OrderNumber; ViewBag.order = order; ViewBag.orderSub = OrderSubList; ViewBag.totalMoney = OrderSubList.Sum((pSub) => { return(pSub.ProductMoney); }); } } else { ViewBag.MunCode = documentDao.CreateCode(); ViewBag.BalCode = orderTableDao.CreateCode(); ViewBag.totalMoney = 0; } Session["orderDOC"] = null; Session["order"] = null; Session["orderSub"] = null; Session["orderCheck"] = null; return(View("~/Views/Obtain/Web/Order.cshtml", Define.MASTER_VIEW)); }
/// <summary> /// 언어 변환 /// </summary> /// <param name="ltype"></param> private IList <CodeMaster> ConvertLanguage(IList <CodeMaster> list, LanguageType?ltype) { foreach (CodeMaster l in list) { l.Trans(ltype); } return(list); }
public IList <CodeMaster> GetCodeMaster(String keyName, LanguageType?ltype) { if (!master.ContainsKey(keyName)) { master.Add(keyName, dao.SelectCodeMaster(keyName)); } return(ConvertLanguage(master[keyName], ltype)); }
public ActionResult ReleaseApprovePage(Int64 idx) { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseApprovePage - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseApprovePage"); LanguageType?lType = GetLanguageType(); Dictionary <String, Object> sessionBuffer = new Dictionary <string, object>(); ProductFlow flow = productFlowDao.SelectProductFlow(idx, CompanySession.CompanyCode); ViewBag.Flow = flow; ViewBag.totalprice = flow.ProductSellPrice * flow.ProductAmount; sessionBuffer.Add("FLOW", flow); if (flow.ApplyType != 0) { //발주서 검색 OrderTable pOrder = orderTableDao.SelectOrderTable(flow.ApplyType, CompanySession.CompanyCode); //정상경로가 아님 if (pOrder.Idx <= 0) { return(ErrorPage("/Home/Error")); } sessionBuffer.Add("ORDER", pOrder); //문서정보 취득 Document pDoc = documentDao.SelectDocument(pOrder.Idx, DOCUMENTSTORECODE, CompanySession.CompanyCode); sessionBuffer.Add("DOCUMENT", pDoc); //서버 상품 검색 IList <OrderTableSub> orderSubList = orderTableSubDao.SelectSubList(pOrder.Idx, CompanySession.CompanyCode, lType); sessionBuffer.Add("SUBLIST", orderSubList); //기본 데이터 Attribute저장 ViewBag.doc = pDoc; ViewBag.order = pOrder; ViewBag.orderSub = orderSubList; //전체 금액 계산 ViewBag.totalMoney = orderSubList.Sum((pSub) => { return(pSub.ProductMoney); }); //코드마스터 취득 ViewBag.moneySendType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.MONEY_SEND_TYPE, lType); } Session["ApproveData"] = sessionBuffer; ViewBag.Commit = COMMIT_SHOUNINNPAGE; Session[Define.Session.ACTION] = "ReleaseCheckList"; return(View("~/Views/Store/Web/ReleaseCheckPage.cshtml", Define.MASTER_VIEW)); }
public PersonalInfo(string firstName, string surname, string city, string postDepartment, string phone, LanguageType?language) { FirstName = firstName; Surname = surname; City = city; PostDepartment = postDepartment; Phone = phone; Language = language; }
/// <summary> /// 从指定资源中获取字符串 /// </summary> /// <param name="fileName">文件名称</param> /// <param name="suffix">后缀名</param> /// <param name="language">语言</param> /// <returns></returns> public static string GetResourceAsString(string fileName, string suffix, LanguageType?language = null) { using (var stream = GetResourceAsStream(fileName, suffix, language)) { using (var reader = new StreamReader(stream, Encoding.UTF8)) { return(reader.ReadToEnd()); } } }
/// <summary> /// 从指定资源中获取泛型列表 /// </summary> /// <typeparam name="T">类型</typeparam> /// <param name="fileName">文件名称</param> /// <param name="convert">转换方式</param> /// <param name="language">语言</param> /// <returns></returns> public IEnumerable <T> GetResourceAsItems <T>(string fileName, Func <string[], T> convert, LanguageType?language = null) { var lines = GetResourceAsLines(fileName, language); foreach (var line in lines) { yield return(convert(line.Split('\t'))); } }
public ActionResult UserInsert(UserInfo rUser) { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Web/UserInsert"); rUser.CreateDate = DateTime.Now; rUser.Creater = UserSession.UserId; LanguageType? lType = (LanguageType?)Session[Define.Session.LANGUAGE_TYPE]; IList <String> pError = rUser.Validate(lType); if (pError.Count > 0) { String ErrMsg = ""; foreach (String pBuffer in pError) { ErrMsg += pBuffer + "<br>"; } ViewBag.ErrMsg = ErrMsg; ViewBag.UserInfo = rUser; Session[Define.Session.ACTION] = "UserInfo"; return(View("~/Views/Web/UserInfo.cshtml", Define.MASTER_VIEW)); } String message = ""; if (Object.Equals(lType, LanguageType.Korea)) { message = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 수정되었습니다."; } else { message = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 修正しました。"; } rUser.Idx = UserSession.Idx; rUser.Password = UserSession.Password; rUser.Permission = UserSession.Permission; rUser.CompanyCode = CompanySession.CompanyCode; rUser.State = Define.NOTDEL; Session[Define.Session.USER_INFO] = rUser; userInfoDao.ModifyUserInfo(rUser, lType, CompanySession.CompanyCode); ViewBag.ErrMsg = message; ViewBag.UserInfo = rUser; Session[Define.Session.ACTION] = "UserInfo"; return(View("~/Views/Web/UserInfo.cshtml", Define.MASTER_VIEW)); }
/// <summary> /// 从指定资源中获取Json对象 /// </summary> /// <typeparam name="T">对象类型</typeparam> /// <param name="fileName">文件名称</param> /// <param name="language">语言</param> /// <returns></returns> public T GetResourceFromJson <T>(string fileName, LanguageType?language = null) { var json = GetResourceAsString(fileName, "json"); if (string.IsNullOrWhiteSpace(json)) { return(default(T)); } return(JsonConvert.DeserializeObject <T>(json)); }
public void Trans(LanguageType?ltype) { if (Object.Equals(ltype, LanguageType.Korea)) { CodeName = codename_k; } else { CodeName = codename_j; } }
// 添加语言 public virtual void Add(LanguageType?type, string key, string desc, string fileName = "", string category = "") { //跳过无效的key和Desc if (type == null) { return; } if (key.IsInv() || desc.IsInv()) { return; } int lanIndex = Enum <LanguageType> .Int(type.Value); if (!lanKeys.Contains(key)) { lanKeys.Add(key); } if (!data.ContainsKey(lanIndex)) { data.Add(lanIndex, new Dictionary <string, string>()); } //添加到Key if (!data[lanIndex].ContainsKey(key)) { data[lanIndex].Add(key, desc); //分类到LoadTip if (key.StartsWith(Const.Prefix_Lang_LoadTip)) { LoadTips.Add(key); } else if (key.StartsWith(Const.Prefix_Lang_Surname)) { AllLastNames.Add(key); } //自定义分类 if (category != "") { if (!categoryKey.ContainsKey(category)) { categoryKey.Add(category, new HashList <string>()); } categoryKey[category].Add(key); } } else { if (Application.isEditor) { CLog.Error("错误!重复的组建key:" + key + " 当前语言:" + type.ToString() + " file Name:" + fileName); } data[lanIndex][key] = desc; } }
public static IList <String> Validate(this UserInfo entity, LanguageType?lType) { IList <String> Errmsg = new List <string>(); if (StaticUtil.NullCheck(entity.UserName)) { if (lType == LanguageType.Korea) { Errmsg.Add("유저명이 입력되지 않았습니다."); } else { Errmsg.Add("名前が入力されてありません。"); } } if (StaticUtil.NullCheck(entity.UserNumber1) || StaticUtil.NullCheck(entity.UserNumber2) || StaticUtil.NullCheck(entity.UserNumber3)) { if (lType == LanguageType.Korea) { Errmsg.Add("전화번호가 입력되지 않았습니다."); } else { Errmsg.Add("電話番号が入力されてありません。"); } } if (StaticUtil.NullCheck(entity.UserEmail)) { if (lType == LanguageType.Korea) { Errmsg.Add("이메일이 입력되지 않았습니다."); } else { Errmsg.Add("Eメールが入力されてありません。"); } } if (!StaticUtil.NullCheck(entity.Password)) { if (!entity.Password.Equals(entity.PasswordCheck)) { if (lType == LanguageType.Korea) { Errmsg.Add("패스워드가 일치하지 않습니다."); } else { Errmsg.Add("パスワードが一致しません。"); } } } return(Errmsg); }
public ActionResult CompanyInsert(CompanyInfo rComp) { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Web/CompanyInsert"); rComp.Creater = UserSession.UserId; rComp.CreateDate = DateTime.Now; LanguageType?lType = (LanguageType?)Session[Define.Session.LANGUAGE_TYPE]; IList <String> pError = rComp.Validate(lType); if (pError.Count > 0) { String ErrMsg = ""; foreach (String pBuffer in pError) { ErrMsg += pBuffer + "<br>"; } ViewBag.ErrMsg = ErrMsg; ViewBag.companyInfo = rComp; Session["action"] = "CompanyInfo"; return(View("~/Views/Web/CompanyInfo.cshtml", Define.MASTER_VIEW)); } String message = ""; companyInfoDao.Modify(rComp, lType); if (Object.Equals(lType, LanguageType.Korea)) { message = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 수정되었습니다."; } else { message = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 修正しました。"; } rComp = CompanySession; Session[Define.Session.COMPANY_INFO] = rComp; ViewBag.ErrMsg = message; ViewBag.companyInfo = rComp; Session[Define.Session.ACTION] = "CompanyInfo"; return(View("~/Views/Web/CompanyInfo.cshtml", Define.MASTER_VIEW)); }
/// <summary> /// 从指定资源中获取字符串行列表 /// </summary> /// <param name="fileName">文件名称</param> /// <param name="language">语言</param> /// <returns></returns> public static IEnumerable <string> GetResourceAsLines(string fileName, LanguageType?language = null) { using (var stream = GetResourceAsStream(fileName, "txt", language)) { using (var reader = new StreamReader(stream, Encoding.UTF8)) { string line; while ((line = reader.ReadLine()) != null) { yield return(line); } } } }
public ActionResult ReleaseAddCheck(ProductFlow pFlow) { if (!SessionCheck(Define.Session.SESSION_CHECK)) { return(ErrorPage("/Home/Error")); } if (!CheckAuth()) { LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseAddCheck - Error"); return(base.Logout()); } LogWriter.Instance().LogWrite(UserSession.UserId, "/Store/ReleaseAddCheck"); LanguageType?lType = GetLanguageType(); Session[Define.Session.ACTION] = "ReleaseAdd"; List <String> pErrmsg = pFlow.Validate(lType); IList <ProductInfo> productList = productInfoDao.GetProductNameList(CompanySession.CompanyCode); //에러가 있는 경우 if (pErrmsg.Count > 0) { String err = ""; foreach (String pData in pErrmsg) { err += pData + "<br>"; } ViewBag.ErrMsg = err; ViewBag.Flow = pFlow; ViewBag.totalprice = pFlow.ProductSellPrice * pFlow.ProductAmount; ViewBag.productlist = productList; ViewBag.userInfo = UserSession; return(View("~/Views/Store/Web/ReleaseAdd.cshtml", Define.MASTER_VIEW)); } //정상의 경우 foreach (ProductInfo pData in productList) { if (pData.Idx == pFlow.ProductIndex) { pFlow.ProductName = pData.ProductName; break; } } ViewBag.Flow = pFlow; ViewBag.totalprice = pFlow.ProductSellPrice * pFlow.ProductAmount; Session["productFlow"] = pFlow; ViewBag.Commit = COMMIT_KAKUNINN; return(View("~/Views/Store/Web/ReleaseAddCheck.cshtml", Define.MASTER_VIEW)); }
/// <summary> /// 기본 Attribute 세팅 /// </summary> protected void ViewSetting(Document doc, OrderTable order, IList <OrderTableSub> subOrder) { LanguageType?lType = GetLanguageType(); //기본 데이터 Attribute저장 ViewBag.doc = doc; ViewBag.order = order; ViewBag.orderSub = subOrder; //전체 금액 계산 ViewBag.totalMoney = subOrder.Sum((pSub) => { return(pSub.ProductMoney); }); //코드마스터 취득 ViewBag.moneySendType = CodeMasterMap.Instance().GetCodeMaster(Define.CodeMaster.MONEY_SEND_TYPE, lType); }