public IHttpActionResult GetCartItems(string version, string UserId) { try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } DataSet ds = new DataSet(); ds = BzWebsite.GetCartItems(version, x_StateName, x_DistrictName, UserId); ds.Tables[0].TableName = "Items"; return(Ok(new { CartApiReponse = ds, ItemCount = ds.Tables[1].Rows[0]["ItemCount"].ToString(), Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { CartApiReponse = "", Status = false })); } }
public IHttpActionResult GetHumTumOffer(string version) { try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } DataSet ds = new DataSet(); ds = LiveStocks.GetHumTumOffer(version, x_StateName, x_DistrictName); //ds.Tables[0].TableName = "TrendsProducts";Product,ProductsApiReponse ds.Tables[0].TableName = "Product"; //return Ok(new { TrendsProductsApiReponse = ds, Status = true }); return(Ok(new { ProductsApiReponse = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { ProductsApiReponse = "", Status = false })); } }
public IHttpActionResult GetKGPCategorySubCategoryWiseDataV2(KitchenGardenEntity objkgpList) { try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } ReasonStatusBal _rsbal = new ReasonStatusBal(); // DataSet ds1 = new DataSet(); var ds1 = _rsbal.GetKGPCategorySubCategoryWiseData(objkgpList, x_StateName, x_DistrictName); ds1.Tables[0].TableName = "Product"; ds1.Tables[1].TableName = "Count"; return(Ok(new { ProductsApiReponse = ds1, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { ProductsApiReponse = "", Status = false })); } }
public IHttpActionResult DelightPushOrderDetail(DLight objDlight) { DlightPostResponse objResponse = new DlightPostResponse(); try { int value = 0; value = ClsDelight.DelightPushOrderDetail(objDlight); if (value > 0) { objResponse.Success = true; objResponse.Msg = "Submitted Successfully"; } else { objResponse.Success = false; objResponse.Msg = "Failed, Try Again!"; } return(Ok(new { BZApiReponse = objResponse, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); objResponse.Msg = "Failed."; } return(Ok(new { BZApiReponse = objResponse, Status = false })); }
public IHttpActionResult AddToCartItems(BzCartItems obj) { BzWebsite _objBal = new BzWebsite(); AddtoCartResult objAddToCart = new AddtoCartResult(); int flag = 0; Dictionary <string, int> returndata = new Dictionary <string, int>(); returndata.Add("status", 0); try { //System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; //string x_StateName = string.Empty; //string x_DistrictName = string.Empty; //if (headers.Contains("state")) //{ // x_StateName = headers.GetValues("state").First().ToLower(); //} //if (headers.Contains("district")) //{ // x_DistrictName = headers.GetValues("district").First().ToLower(); //} objAddToCart = _objBal.AddToCart(obj); return(Ok(new { Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, objAddToCart.Status); return(Ok(new { Status = false })); } }
public void ReturnComplete() { ReturnHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要完成的单据。"); return; } if (header.BillState == "27") { MsgBox.Warn("该订单已经完成,请选择其他订单!"); return; } if (MsgBox.AskOK("确定要完成该订单吗?") == DialogResult.OK) { bool result = CloseReturn(header.BillID); if (result) { MsgBox.Warn("订单关闭完成!"); LogDal.Insert(ELogType.退货单, GlobeSettings.LoginedUser.UserName, header.BillNo, "手动完成退货单", "退货单管理"); } //else //{ // MsgBox.Warn(result); //} } }
public IHttpActionResult GetBzAppActiveBrands(string version) { try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } DataSet ds = new DataSet(); ds = BzCatagory.ActiveBrands(version, x_StateName, x_DistrictName); ds.Tables[0].TableName = "BZActiveBrands"; return(Ok(new { BZBrands = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { BZBrands = "", Status = false })); } }
public IHttpActionResult GetBrandWiseProduct(string version, int?CategoryId, int BrandId, int DistrictId, int PageIndex, int PageSize) { try { DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); ds = LiveStocks.GetCategoryWiseProduct(version, CategoryId, null, DistrictId, BrandId, PageIndex, PageSize); ds.Tables[0].TableName = "Product"; ds.Tables[1].TableName = "BrandCategory"; ds1.Tables.Add(ds.Tables["Product"].Copy()); var productData = ds.Tables[0].AsEnumerable(); var distinctData = productData.Select(x => x.Field <string>("ProductHindiName")).Distinct(); if (ds.Tables[0].Rows.Count > 0) { return(Ok(new { ProductsApiReponse = ds1, Status = true })); } else { return(Ok(new { ProductsApiReponse = "", Status = false })); } } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { ProductsApiReponse = "", Status = false })); } }
public CreatedOrderResult OrderCreateV2(OrderCreateModel obj) { ReasonStatusBal _rsbal = new ReasonStatusBal(); CreatedOrderResult objCreateOrderData = new CreatedOrderResult(); int flag = 0; Dictionary <string, int> returndata = new Dictionary <string, int>(); returndata.Add("status", 0); try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } objCreateOrderData = _rsbal.OrderCreateV2(obj, x_StateName, x_DistrictName); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, obj.userid); } // string json = JsonConvert.SerializeObject(returndata); //HttpContext.Current.Response.ContentType = "application/json; charset=utf-8"; //HttpContext.Current.Response.Write(json); return(objCreateOrderData); }
private void RepSO_AfterPrint(object sender, EventArgs e) { //记录打印张数和人 int pageCount = this.Pages.Count * this.copies; //new BillLogDal().SavePrintLog(header.BillNO, pageCount, "打印销货单", GlobeSettings.LoginedUser.UserName); LogDal.Insert(ELogType.打印, GlobeSettings.LoginedUser.UserName, dataSource.Header.BillNo, "销售退货单", this._module + "-RepReturn"); }
public IHttpActionResult GetOrderTracking(string version, int UserId) { try { List <OrderTracking> objOrderList = new List <OrderTracking>(); DataSet ds = new DataSet(); ds = BzWebsite.GetOrderTracking(version, UserId); ds.Tables[0].TableName = "Orders"; ds.Tables[1].TableName = "OrderItems"; var Orders = ds.Tables["Orders"].AsEnumerable(); var OrderItems = ds.Tables["OrderItems"].AsEnumerable(); //var kgpBrands = ds1.Tables["KGPBrands"].AsEnumerable(); foreach (var item in Orders) { OrderTracking objOrder = new OrderTracking(); objOrder.OrderId = item.Field <int>("OrderId"); objOrder.TotalSaleValue = item.Field <decimal>("TotalSaleValue"); objOrder.DeliveryCharge = item.Field <decimal>("DeliveryCharge"); objOrder.OrderStatus = item.Field <string>("OrderStatus"); objOrder.OrderDate = item.Field <string>("PurchasedDate"); List <OrderItems> objItems = new List <OrderItems>(); objOrder.OrderItems = objItems; objOrderList.Add(objOrder); } foreach (var item1 in objOrderList) { foreach (var item2 in OrderItems) { if (item2.Field <int>("OrderId") == item1.OrderId) { item1.OrderItems.Add(new OrderItems { // RecordId =item2.Field<long>("RecordId"), PackageId = item2.Field <int>("PackageId"), ProductName = item2.Field <string>("ProductName"), TechnicalName = item2.Field <string>("TechnicalName"), OrderStatus = item2.Field <string>("OrderStatus"), OrderDate = item2.Field <string>("PurchasedDate"), DeliveryDate = item2.Field <string>("DeilveredDate"), Quantity = item2.Field <short>("Quantity"), PackSize = item2.Field <string>("PackSize"), UnitPrice = item2.Field <decimal>("UnitPrice"), SaleValue = item2.Field <decimal>("SaleValue"), ImagePath = item2.Field <string>("ImagePath") }); } } } return(Ok(new { Orders = objOrderList, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { KGPApiReponse = "", Status = false })); } }
public IHttpActionResult BZFarmerAppServices(string version) { try { System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("state")) { x_StateName = headers.GetValues("state").First().ToLower(); } if (headers.Contains("district")) { x_DistrictName = headers.GetValues("district").First().ToLower(); } DataSet ds = new DataSet(); ds = LiveStocks.AppServices(version, x_StateName, x_DistrictName); if (ds.Tables.Count > 0) { List <dynamic> objlist = new List <dynamic>(); if (ds.Tables.Count > 2) { ds.Tables[0].TableName = "BZFarmerAppServices"; ds.Tables[1].TableName = "District"; ds.Tables[2].TableName = "State"; var Location = new { DistrictId = ds.Tables[1].Rows[0]["DistrictId"], StateId = ds.Tables[2].Rows[0]["State"] }; objlist.Add(Location); } else { var Location = new { DistrictId = "", StateId = "" }; objlist.Add(Location); } DataSet ds1 = new DataSet(); ds.Tables[0].TableName = "BZFarmerAppServices"; ds1.Tables.Add(ds.Tables[0].Copy()); return(Ok(new { BZApiReponse = ds1, Location = objlist, Status = true })); } else { return(Ok(new { BZApiReponse = "", Msg = "Jankari", Status = false })); } } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { BZApiReponse = "", Msg = "Jankari", Status = false })); } }
public object CreateViewModel(DependencyObject sender) { IWindowFactory windowFactoryEdit = new EditLogWindowFactory(); ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); EditDeleteLogViewModel vm = new EditDeleteLogViewModel(windowFactoryEdit, log); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); return(vm); }
public IActionResult ChangePassword(FrameChangePassword model) { if (ModelState.IsValid) { var dal = new AdministratorDal(); try { CryptoHelper helper = new CryptoHelper(); var p = CurrentAdmin; var old = dal.FindByAccounts(model.Accounts.Trim().ToLower()); if (old != null) { if (old.AdministratorId != p.AdministratorId) { ModelState.AddModelError("", "该账号已经被占用."); return(View(model)); } } if (model.OldPassword.Trim() == helper.Decrypt(p.PassWord.Trim())) { var logMode = new LogDefinition() { Content = "修改密码", AdminName = p.Name, AfterUpdate = "", BeforeUpdate = "", UpdateDateTime = DateTime.Now, }; var logDal = new LogDal(); logDal.Add(logMode); p.PassWord = helper.Encrypt(model.NewPassword); p.Accounts = model.Accounts.Trim().ToLower(); dal.Update(p); CurrentAdmin = null; return(RedirectToAction("LogOn", "Account")); } else { ModelState.AddModelError("", "密码不正确."); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); } } //model.OldPassword = ""; //model.NewPassword = ""; //model.ConfirmPassword = ""; return(View(model)); }
public object CreateViewModel(DependencyObject sender) { EditLogViewModel vm = new EditLogViewModel(); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); ITourDal tourDal = new TourDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ITourService>(new TourService(tourDal)); return(vm); }
public object CreateViewModel(DependencyObject sender) { ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); AddLogViewModel vm = new AddLogViewModel(log); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); ITourDal tourDal = new TourDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ITourService>(new TourService(tourDal)); return(vm); }
public object CreateViewModel(DependencyObject sender) { IWindowFactory windowFactoryResult = new SearchResultWindowFactory(); SearchViewModel vm = new SearchViewModel(windowFactoryResult); ITourDal tourDal = new TourDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ITourService>(new TourService(tourDal)); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); return(vm); }
public object CreateViewModel(DependencyObject sender) { IWindowFactory windowFactoryAdd = new AddLogWindowFactory(); IWindowFactory windowFactoryDeleteEdit = new EditDeleteLogWindowFactory(); LogListViewModel vm = new LogListViewModel(windowFactoryAdd, windowFactoryDeleteEdit); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); vm.ServiceLocator.RegisterService <IReportService>(new PdfReportService(ConfigurationManager.AppSettings["base_directory"], $"{ConfigurationManager.AppSettings["download_directory"]}Reports\\")); ObserverSingleton.GetInstance.LogObservers.Add(vm); ObserverSingleton.GetInstance.TourObservers.Add(vm); return(vm); }
protected void Page_Load(object sender, EventArgs e) { var Id = Request["ID"]; using (var con = DAL.con()) { var Item = LogDal.SelectById(con, Convert.ToInt32(Id)); View1.Item = Item; //var obj =(ChamSoc)Lib.XmlDeserializeFromString(Item.GiaTriMoi, typeof(ChamSoc)); //Response.Write(obj.Ma); } }
public void SetResult(string result, SimpleLabelItem label) { if (result == "Y") { label.Text = String.Format(" 修改成功"); label.AppearanceItemCaption.BackColor = Color.PaleGreen; LogDal.Insert(Nodes.Entities.ELogType.应急处理_退货单, String.Format("{0}:{1}", GlobeSettings.LoginedUser.UserName, GlobeSettings.LoginedUser.UserCode), txtReturnBillID.Text, "应急处理"); } else { label.Text = String.Format(" {0}", result); label.AppearanceItemCaption.BackColor = Color.Red; } }
public ActionResult Desktop() { var logDal = new LogDal(); var model = new HomeModelDesktop() { UserCount = 0, DeviceCount = 0, DeviceCountOfPowerFlag = 0, Log = logDal.QueryNearN(10), DeviceCountOfOnLine = 0, }; return(View(model)); }
public IHttpActionResult Get_BZFarmerAppMainCategory(string version) { try { DataSet ds = new DataSet(); ds = BzCatagory.AppMainCategory(version); ds.Tables[0].TableName = "BZFarmerAppMainCategory"; return(Ok(new { BZAppCatagory = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { BZAppCatagory = "", Status = false })); } }
public IHttpActionResult PaymentOption(string version) { try { DataSet ds = new DataSet(); ds = BzCatagory.GetPaymentOption(version); ds.Tables[0].TableName = "PaymentOption"; return(Ok(new { BZAppPaymentOption = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { BZAppPaymentOption = "", Status = false })); } }
public IHttpActionResult GetBZLiveStockBreed(int LiveStockId, string version) { try { DataSet ds = new DataSet(); ds = LiveStocks.BZLiveStockBreed(LiveStockId, version); ds.Tables[0].TableName = "BZLiveStockBreed"; return(Ok(new { BZApiReponse = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { BZApiReponse = "", Status = false })); } }
public IHttpActionResult GetBZCropBreed(string version, int CropId) { try { DataSet ds = new DataSet(); ds = BZCrops.GetBZCropBreedList(version, CropId); ds.Tables[0].TableName = "CropBreed"; return(Ok(new { BZApiReponse = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { Results = "", Status = false })); } }
public IHttpActionResult GetBzPackages(string version, int ProductId) { try { DataSet ds = new DataSet(); ds = BzWebsite.GetBzPackages(version, ProductId); ds.Tables[0].TableName = "Product"; return(Ok(new { ProductsApiReponse = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { ProductsApiReponse = "", Status = false })); } }
public IHttpActionResult GetBzCategoryForProductDetail(int Id, string Type) { try { DataSet ds = new DataSet(); ds = BzWebsite.GetBzCategoryForProductDetail(Id, Type); ds.Tables[0].TableName = "Category"; return(Ok(new { Category = ds, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { Category = "", Status = false })); } }
public IHttpActionResult GetSubCategory(string version, int?CategoryId) { try { #region Authentication Token //System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; //string token = string.Empty; //string pwd = string.Empty; //if (headers.Contains("username")) //{ // token = headers.GetValues("username").First(); //} //if (headers.Contains("password")) //{ // pwd = headers.GetValues("password").First(); //} #endregion System.Net.Http.Headers.HttpRequestHeaders headers = this.Request.Headers; string x_StateName = string.Empty; string x_DistrictName = string.Empty; if (headers.Contains("x_StateName")) { x_StateName = headers.GetValues("x_StateName").First(); } if (headers.Contains("x_DistrictName")) { x_DistrictName = headers.GetValues("x_DistrictName").First(); } DataSet ds1 = new DataSet(); //if (CategoryId == 2) //{ // ds1 = LiveStocks.GetCropDetails(version, CategoryId); //} //else //{ ds1 = LiveStocks.GetSubCategories(version, CategoryId, true, x_StateName, x_DistrictName); //} ds1.Tables[0].TableName = "SubCategory"; return(Ok(new { ProductsApiReponse = ds1, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { ProductsApiReponse = "", Status = false })); } }
public IActionResult LogOn(AccountLogOnModel model) { if (ModelState.IsValid) { var administratorDal = new AdministratorDal(); try { var p = administratorDal.FindByAccounts(model.Accounts.ToLower()); if (p != null) { //Url.IsLocalUrl(returnUrl) CryptoHelper helper = new CryptoHelper(); if (p.PassWord.Trim() == helper.Encrypt(model.Password)) { Cache.SetString("CurrentAdmin", p.AdministratorId); HttpContext.Session.SetString("CurrentAdmin", p.AdministratorId); var logMode = new LogDefinition() { Content = "登录", AdminName = p.Name, AfterUpdate = "", BeforeUpdate = "", UpdateDateTime = DateTime.Now, }; var logDal = new LogDal(); logDal.Add(logMode); return(RedirectToAction("Index", "Frame")); } else { ModelState.AddModelError("", "密码不正确."); } } else { ModelState.AddModelError("", "找不到该账号."); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); } } // If we got this far, something failed, redisplay form return(View(model)); }
public IHttpActionResult GetOrderTrackingStatus(string version, string OrderId) { try { DataSet ds = new DataSet(); ds = BzWebsite.GetOrderTrackingStatus(version, OrderId); ds.Tables[0].TableName = "OrderTrack"; return(Ok(new { TrackingApiResponse = ds, ItemCount = ds.Tables[0].Rows.Count, Status = true })); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); return(Ok(new { CartApiReponse = "", Status = false })); } }