public List <clsAllocation> GetAllAllocationList(clsDocumentFilter clsdoc) { List <clsAllocation> lst = new List <clsAllocation>(); using (SqlConnection conn = new SqlConnection(strConn)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("TMR_USP_GetAllAllocations")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn; cmd.Parameters.AddWithValue("@RegistrationNo", clsdoc.strRegistrationNo); cmd.Parameters.AddWithValue("@ProjectID", clsdoc.strProjectID); cmd.Parameters.AddWithValue("@ClientID", clsdoc.strClientID); cmd.Parameters.AddWithValue("@StartDate", clsdoc.dateStartDate); cmd.Parameters.AddWithValue("@EndDate", clsdoc.dateEndDate); cmd.Parameters.AddWithValue("@ApprovalStatusCode", clsdoc.intApprovalStatusCode); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { var info = new clsAllocation(); info.RegistrationOrBookingNo = reader["RegistrationNo"].ToString(); info.strProjectid = reader["ProjectID"].ToString(); info.strBlock = reader["Block"].ToString(); info.strUnitID = reader["UnitID"].ToString(); info.strClientID = reader["ClientID"].ToString(); info.dtAllocationDate = Convert.ToDateTime(reader["AllocationDate"]); info.bitApprove = Convert.ToBoolean(reader["Approve"]); info.strRemarks = reader["Remarks"].ToString(); info.ApprovalStatusCode = Convert.ToInt32(reader["ApprovalStatusCode"].ToString()); info.ApprovalStatusDescription = reader["ApprovalStatusDescription"].ToString(); info.ApprovalActionUser = reader["ApprovalActionUser"].ToString(); info.ApprovalActionDate = Convert.ToDateTime(reader["ApprovalActionDate"]); info.CreatedBy = reader["CreatedBy"].ToString(); info.CreationDate = Convert.ToDateTime(reader["CreationDate"].ToString()); info.LastUpdateUser = reader["LastUpdateUser"].ToString(); info.LastUpdateDate = Convert.ToDateTime(reader["LastUpdateDate"]); info.intPreviousStatusCode = Convert.ToInt32(reader["PreviousStatusCode"]); info.StatusDescription = reader["StatusDescription"].ToString(); info.id = Convert.ToInt32(reader["id"].ToString()); lst.Add(info); } conn.Close(); } } return(lst); }
public List <clsCommission> GetAllCommList(clsDocumentFilter clsdoc) { List <clsCommission> lst = new List <clsCommission>(); using (SqlConnection conn = new SqlConnection(strConn)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("TMR_USP_GetAllCommissionList")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn; cmd.Parameters.AddWithValue("@RegistrationNo", clsdoc.strRegistrationNo); cmd.Parameters.AddWithValue("@ProjectID", clsdoc.strProjectID); cmd.Parameters.AddWithValue("@ClientID", clsdoc.strClientID); cmd.Parameters.AddWithValue("@StartDate", clsdoc.dateStartDate); cmd.Parameters.AddWithValue("@EndDate", clsdoc.dateEndDate); cmd.Parameters.AddWithValue("@EntryNumber", clsdoc.strDocNumber); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { var info = new clsCommission(); info.strRegistration = reader["RegistrationNo"].ToString(); info.strClientID = reader["ClientID"].ToString(); info.strClientName = reader["ClientName"].ToString(); info.strEntryNumber = reader["EntryNumber"].ToString(); info.DocumentDate = Convert.ToDateTime(reader["DocumentDate"]); info.decAmount = Convert.ToDecimal(reader["Amount"]); info.strRemarks = reader["Remarks"].ToString(); info.intID = Convert.ToInt32(reader["id"]); //RegistrationNo, ClientID, ClientName, EntryNumber, DocumentDate, Amount, Remarks, id lst.Add(info); } conn.Close(); } } return(lst); }
public List <clsTransferHistory> GetAllTransferHistoryList(clsDocumentFilter clsdoc) { List <clsTransferHistory> lst = new List <clsTransferHistory>(); using (SqlConnection conn = new SqlConnection(strConn)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("TMR_USP_GetAllTransferHistory")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn; cmd.Parameters.AddWithValue("@RegistrationNo", clsdoc.strRegistrationNo); cmd.Parameters.AddWithValue("@ProjectID", clsdoc.strProjectID); cmd.Parameters.AddWithValue("@TransferFromID", clsdoc.strClientID); cmd.Parameters.AddWithValue("@TransferToID", clsdoc.strToClientID); cmd.Parameters.AddWithValue("@StartDate", clsdoc.dateStartDate); cmd.Parameters.AddWithValue("@EndDate", clsdoc.dateEndDate); cmd.Parameters.AddWithValue("@ApprovalStatusCode", clsdoc.intApprovalStatusCode); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { var info = new clsTransferHistory(); info.intID = Convert.ToInt32(reader["ID"].ToString()); info.strRegistrationNo = reader["RegistrationNo"].ToString(); info.strTransferFromID = reader["TransferFromID"].ToString(); info.strTransferToID = reader["TransferToID"].ToString(); info.dtTransferDate = Convert.ToDateTime(reader["TransferDate"]); info.ApprovalStatusCode = Convert.ToInt32(reader["ApprovalStatusCode"].ToString()); info.ApprovalStatusDescription = reader["ApprovalStatusDescription"].ToString(); info.ApprovalActionUser = reader["ApprovalActionUser"].ToString(); info.ApprovalStatusCode = Convert.ToInt32(reader["ApprovalStatusCode"].ToString()); info.ApprovalStatusDescription = reader["ApprovalStatusDescription"].ToString(); info.ApprovalActionUser = reader["ApprovalActionUser"].ToString(); info.ApprovalActionDate = Convert.ToDateTime(reader["ApprovalActionDate"]); info.CreatedBy = reader["CreatedBy"].ToString(); info.CreationDate = Convert.ToDateTime(reader["CreationDate"].ToString()); info.LastUpdateUser = reader["LastUpdateUser"].ToString(); info.LastUpdateDate = Convert.ToDateTime(reader["LastUpdateDate"]); info.strName = reader["Name"].ToString(); info.strFatherOrHusbandType = reader["FatherOrHusbandType"].ToString(); info.strFatherOrHusband = reader["FatherOrHusbandName"].ToString(); info.strNIDOrCNIC = reader["CNIC"].ToString(); info.strNationality = reader["Nationality"].ToString(); info.dtDOB = Convert.ToDateTime(reader["DOB"].ToString()); info.strCurrentAddress1 = reader["CurrentAddress1"].ToString(); info.strCurrentAddress2 = reader["CurrentAddress2"].ToString(); info.strCurrentAddress3 = reader["CurrentAddress3"].ToString(); info.strCountry = reader["Country"].ToString(); info.strCity = reader["City"].ToString(); info.strPhOff = reader["PhOff"].ToString(); info.strRes = reader["Res"].ToString(); info.strMob = reader["Mob"].ToString(); info.strEmailAddress = reader["EmailAddress"].ToString(); lst.Add(info); } conn.Close(); } } return(lst); }