public Store Get_Default(long DepID) { Department_DL objDep_DL = new Department_DL(Connection); Employee_DL objEmp_DL = new Employee_DL(Connection); Store objStore = new Store(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@StoreDepID", DepID) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_Store_Default", paramList); objStore.StoreDepartment = objDep_DL.Get(Convert.ToInt64(dt.Rows[0]["StoreDepID"])); objStore.StoreDescription = Convert.ToString(dt.Rows[0]["StoreDesription"]); objStore.StoreID = Convert.ToString(dt.Rows[0]["StoreID"]); objStore.StoreKeeper = objEmp_DL.Get(Convert.ToString(dt.Rows[0]["StoreKeeper"])); objStore.StoreName = Convert.ToString(dt.Rows[0]["StoreName"]); return(objStore); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public StoreCollec Get() { Department_DL objDep_DL = new Department_DL(Connection); Employee_DL objEmp_DL = new Employee_DL(Connection); StoreCollec objStoreCollec = new StoreCollec(); try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_Store"); for (int i = 0; i < dt.Rows.Count; i++) { Store objStore = new Store(); objStore.StoreDepartment = objDep_DL.Get(Convert.ToInt64(dt.Rows[i]["StoreDepID"])); objStore.StoreDescription = Convert.ToString(dt.Rows[i]["StoreDesription"]); objStore.StoreID = Convert.ToString(dt.Rows[i]["StoreID"]); objStore.StoreKeeper = objEmp_DL.Get(Convert.ToString(dt.Rows[i]["StoreKeeper"])); objStore.StoreName = Convert.ToString(dt.Rows[i]["StoreName"]); objStoreCollec.Add(objStore); } return(objStoreCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MTNCollec Get(long FromDepID, MTN.Status Status) { Employee_DL objEmployee_DL = new Employee_DL(Connection); Department_DL objDepartment_DL = new Department_DL(Connection); MTNCollec objMTNCollec = new MTNCollec(); Store_DL objStore_DL = new Store_DL(Connection); GRN_DL objGRN_DL = new GRN_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@DepID", FromDepID), new SqlParameter("@MTNStatus", Status) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTN_ByFromDep_Status", paramList); for (int i = 0; i < dt.Rows.Count; i++) { MTN objMTN = new MTN(); objMTN.MTNApprovedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNApprovedBy"])); objMTN.MTNApprovedDate = Convert.ToDateTime(dt.Rows[i]["MTNApproveDate"]); objMTN.MTNBatch = "No"; objMTN.MTNDate = Convert.ToDateTime(dt.Rows[i]["MTNDate"]); objMTN.MTNDepartmentFrom = objDepartment_DL.Get(Convert.ToInt64(dt.Rows[i]["MTNFromDepID"])); objMTN.MTNDepartmentTo = objDepartment_DL.Get(Convert.ToInt64(dt.Rows[i]["MTNToDepID"])); objMTN.MTNEnterdBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNEnterdBy"])); objMTN.MTNNo = Convert.ToInt64(dt.Rows[i]["MTNNo"]); objMTN.MTNReceivedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNReceivedBy"])); objMTN.MTNReceivedDate = Convert.ToDateTime(dt.Rows[i]["MTNReceivedDate"]); objMTN.MTNStatus = (MTN.Status)dt.Rows[i]["MTNStatus"]; objMTN.MTNType = (MTN.Type)dt.Rows[i]["MTNType"]; objMTN.MTNItemType = (MTN.ItemType)dt.Rows[i]["MTNItemType"]; objMTN.MTNStore = objStore_DL.Get(Convert.ToString(dt.Rows[i]["MTNStore"])); objMTNCollec.Add(objMTN); } return(objMTNCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MR Get(long MRNO) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MRNO", MRNO) }; MR objMR = new MR(); DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MRByID", paramList); if (dt.Rows.Count > 0) { if (dt.Rows[0]["MRApprovedBy"] != null) { objMR.MRApprovedBy = Convert.ToString(dt.Rows[0]["MRApprovedBy"]); } if (dt.Rows[0]["MRApproveDate"] != null) { objMR.MRApprovedDate = Convert.ToDateTime(dt.Rows[0]["MRApproveDate"]); } objMR.MRDate = Convert.ToDateTime(dt.Rows[0]["MRDate"]); objMR.MRDepartmentFrom = objDepartment_DL.Get(Convert.ToInt64(dt.Rows[0]["MRFromDepID"])); objMR.MREnterdBy = Convert.ToString(dt.Rows[0]["MREnterdBy"]); if (dt.Rows[0]["MRIssuedBy"] != null) { objMR.MRIssuedBy = Convert.ToString(dt.Rows[0]["MRIssuedBy"]); } if (dt.Rows[0]["MRIssuedDate"] != null) { objMR.MRIssuedDate = Convert.ToDateTime(dt.Rows[0]["MRIssuedDate"]); } objMR.MRNO = Convert.ToInt64(dt.Rows[0]["MRNO"]); if (dt.Rows[0]["MRReceivedBy"] != null) { objMR.MRReceivedBy = Convert.ToString(dt.Rows[0]["MRReceivedBy"]); } if (dt.Rows[0]["MRReceivedDate"] != null) { objMR.MRReceivedDate = Convert.ToDateTime(dt.Rows[0]["MRReceivedDate"]); } objMR.MRRemarks = Convert.ToString(dt.Rows[0]["MRNO"]); objMR.MRStatus = (MR.Status)dt.Rows[0]["MRStatus"]; objMR.MRType = (MR.Type)dt.Rows[0]["MRType"]; objMR.MRStore = objStore_DL.Get(Convert.ToString(dt.Rows[0]["MRStore"])); if (dt.Rows[0]["MRSectionID"] != DBNull.Value) { objMR.SectionID = Convert.ToInt64(dt.Rows[0]["MRSectionID"]); } objMR.OriginType = (MR.Origin)dt.Rows[0]["OriginType"]; if (dt.Rows[0]["MRPrint"] != DBNull.Value) { objMR.Print = Convert.ToBoolean(dt.Rows[0]["MRPrint"]); } if (dt.Rows[0]["MRBulkPrint"] != DBNull.Value) { objMR.BulkPrint = Convert.ToBoolean(dt.Rows[0]["MRBulkPrint"]); } } return(objMR); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }