public DataTable GetDataReportHandlingFee(DateTime PeriodeStart, DateTime PeriodeEnd, Int32 TBBM, string Force, string Unity) { return(DbTransaction.DbToDataTable("dbo.sp_RepHandlingFee", new { Start = PeriodeStart, End = PeriodeEnd, TBBM = TBBM, Force = Force, Unity = Unity }, true)); }
public MS_UserAccount_Response LoginAuthentication(MS_UserAccount_Request req) { MS_UserAccount_Response RetVal = new MS_UserAccount_Response(); try { DataTable dt = DBtran.DbToDataTable("[dbo].[USP_LOGIN_AUTHENTICATION]", new { UserName = req.UserName, Password = req.Password }, true); foreach (DataRow row in dt.Rows) { RetVal.UserID_PK = string.IsNullOrEmpty(row["UserID_PK"].ToString()) ? 0 : Convert.ToInt32(row["UserID_PK"]); RetVal.UserName = string.IsNullOrEmpty(row["UserName"].ToString()) ? "" : row["UserName"].ToString(); RetVal.Password = string.IsNullOrEmpty(row["Password"].ToString()) ? "" : row["Password"].ToString(); RetVal.IsActive = string.IsNullOrEmpty(row["IsActive"].ToString()) ? true : Convert.ToBoolean(row["IsActive"]); RetVal.IsDelete = string.IsNullOrEmpty(row["IsDelete"].ToString()) ? true : Convert.ToBoolean(row["IsDelete"]); RetVal.CreatedBy = string.IsNullOrEmpty(row["CreatedBy"].ToString()) ? "" : row["CreatedBy"].ToString(); RetVal.CreatedDate = string.IsNullOrEmpty(row["CreatedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["CreatedDate"]); RetVal.ModifiedBy = string.IsNullOrEmpty(row["ModifiedBy"].ToString()) ? "" : row["ModifiedBy"].ToString(); RetVal.ModifiedDate = string.IsNullOrEmpty(row["ModifiedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["ModifiedDate"]); RetVal.Authentication = string.IsNullOrEmpty(row["Authentication"].ToString()) ? true : Convert.ToBoolean(row["Authentication"]); RetVal.ResponseMessage = string.IsNullOrEmpty(row["ResponseMessage"].ToString()) ? "" : (row["ResponseMessage"].ToString()); } } catch (Exception ex) { RetVal = null; throw ex; } finally { } return(RetVal); }
public List <TR_Cart_Response> GetCart(TR_Cart_Request req) { List <TR_Cart_Response> RetVal = new List <TR_Cart_Response>(); try { DataTable dt = DBtran.DbToDataTable("[dbo].[USP_GET_CART]", new { pCartID = req.CartID_PK == null ? 0 : req.CartID_PK, pUserName = req.UserName == null ? "" : req.UserName, pUserID = req.UserID_FK == null ? 0 : req.UserID_FK, pProductID = req.ProductID_FK == null ? 0 : req.ProductID_FK, pQuantity = req.Quantity == null ? 0 : req.Quantity }, true); foreach (DataRow row in dt.Rows) { RetVal.Add(new TR_Cart_Response { CartID_PK = string.IsNullOrEmpty(row["CartID_PK"].ToString()) ? 0 : Convert.ToInt32(row["CartID_PK"]), UserID_FK = string.IsNullOrEmpty(row["UserID_FK"].ToString()) ? 0 : Convert.ToInt32(row["UserID_FK"]), UserName = string.IsNullOrEmpty(row["UserName"].ToString()) ? "" : row["UserName"].ToString(), ProductID_FK = string.IsNullOrEmpty(row["ProductID_FK"].ToString()) ? 0 : Convert.ToInt32(row["ProductID_FK"]), SellerID_FK = string.IsNullOrEmpty(row["SellerID_FK"].ToString()) ? 0 : Convert.ToInt32(row["SellerID_FK"]), SellerName = string.IsNullOrEmpty(row["SellerName"].ToString()) ? "" : row["SellerName"].ToString(), ProductName = string.IsNullOrEmpty(row["ProductName"].ToString()) ? "" : row["ProductName"].ToString(), ProductImage = string.IsNullOrEmpty(row["ProductImage"].ToString()) ? "" : row["ProductImage"].ToString(), Price = string.IsNullOrEmpty(row["Price"].ToString()) ? 0 : Convert.ToInt32(row["Price"]), Stock = string.IsNullOrEmpty(row["Stock"].ToString()) ? 0 : Convert.ToInt32(row["Stock"]), Quantity = string.IsNullOrEmpty(row["Quantity"].ToString()) ? 0 : Convert.ToInt32(row["Quantity"]), FlagActive = string.IsNullOrEmpty(row["FlagActive"].ToString()) ? true : Convert.ToBoolean(row["FlagActive"]), FlagDelete = string.IsNullOrEmpty(row["FlagDelete"].ToString()) ? true : Convert.ToBoolean(row["FlagDelete"]), CreatedBy = string.IsNullOrEmpty(row["CreatedBy"].ToString()) ? "" : row["CreatedBy"].ToString(), CreatedDate = string.IsNullOrEmpty(row["CreatedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["CreatedDate"]), ModifiedBy = string.IsNullOrEmpty(row["ModifiedBy"].ToString()) ? "" : row["ModifiedBy"].ToString(), ModifiedDate = string.IsNullOrEmpty(row["ModifiedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["ModifiedDate"]), RecordTotal = string.IsNullOrEmpty(row["RecordTotal"].ToString()) ? 0 : Convert.ToInt32(row["RecordTotal"]) }); } } catch (Exception ex) { RetVal = null; throw ex; } return(RetVal); }
public List <MS_Product_Response> GetProduct(MS_Product_Request req) { List <MS_Product_Response> RetVal = new List <MS_Product_Response>(); try { DataTable dt = DBtran.DbToDataTable("[dbo].[USP_GET_PRODUCT]", new { pProductID = req.ProductID_PK == null ? 0 : req.ProductID_PK, pSellerID = req.SellerID_FK == null ? 0 : req.SellerID_FK, pCategoryID = req.CategoryID_FK == null ? 0 : req.CategoryID_FK, pIsActive = req.IsActive == null ? true : req.IsActive }, true); foreach (DataRow row in dt.Rows) { RetVal.Add(new MS_Product_Response { ProductID_PK = string.IsNullOrEmpty(row["ProductID_PK"].ToString()) ? 0 : Convert.ToInt32(row["ProductID_PK"]), SellerID_FK = string.IsNullOrEmpty(row["SellerID_FK"].ToString()) ? 0 : Convert.ToInt32(row["SellerID_FK"]), CategoryID_FK = string.IsNullOrEmpty(row["CategoryID_FK"].ToString()) ? 0 : Convert.ToInt32(row["CategoryID_FK"]), ProductName = string.IsNullOrEmpty(row["ProductName"].ToString()) ? "" : row["ProductName"].ToString(), Description = string.IsNullOrEmpty(row["Description"].ToString()) ? "" : row["Description"].ToString(), Stock = string.IsNullOrEmpty(row["Stock"].ToString()) ? 0 : Convert.ToInt32(row["Stock"]), Price = string.IsNullOrEmpty(row["Price"].ToString()) ? 0 : Convert.ToInt32(row["Price"]), ProductSeen = string.IsNullOrEmpty(row["ProductSeen"].ToString()) ? 0 : Convert.ToInt32(row["ProductSeen"]), ProductImage = string.IsNullOrEmpty(row["ProductImage"].ToString()) ? "" : row["ProductImage"].ToString(), IsActive = string.IsNullOrEmpty(row["IsActive"].ToString()) ? true : Convert.ToBoolean(row["IsActive"]), IsDelete = string.IsNullOrEmpty(row["IsDelete"].ToString()) ? true : Convert.ToBoolean(row["IsDelete"]), CreatedBy = string.IsNullOrEmpty(row["CreatedBy"].ToString()) ? "" : row["CreatedBy"].ToString(), CreatedDate = string.IsNullOrEmpty(row["CreatedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["CreatedDate"]), ModifiedBy = string.IsNullOrEmpty(row["ModifiedBy"].ToString()) ? "" : row["ModifiedBy"].ToString(), ModifiedDate = string.IsNullOrEmpty(row["ModifiedDate"].ToString()) ? DateTime.Now : Convert.ToDateTime(row["ModifiedDate"]), RecordTotal = string.IsNullOrEmpty(row["RecordTotal"].ToString()) ? 0 : Convert.ToInt32(row["RecordTotal"]) }); } } catch (Exception ex) { RetVal = null; throw ex; } return(RetVal); }