Beispiel #1
0
        public KeyValuePair <string, List <AllocationAccount> > GetAllocationTransAccountUpdateRecord(string recordID, int page, int pageSize, string whereCondition, string sort)
        {
            AllocationAccount AllocationAc = new AllocationAccount();

            SqlParameter[] Parameters       = { new SqlParameter("@AllocationSNo", recordID), new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", whereCondition), new SqlParameter("@OrderBy", sort) };
            DataSet        ds               = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetRecordAllocationTransULDIns", Parameters);
            var            AllocationAcList = ds.Tables[0].AsEnumerable().Select(e => new AllocationAccount
            {
                SNo = 0,
                AllocationTransSNo = Convert.ToInt32(e["SNo"].ToString()),
                AllDays            = Convert.ToBoolean(e["AllDays"]),
                lblAllDays         = "Days",
                AllDay             = e["AllDays"].ToString().Contains("1") ? "Yes" : "No",
                Day1    = Convert.ToBoolean(e["Day1"]),
                lblDay1 = "Sun",
                Sun     = e["Day1"].ToString().Contains("True") ? "Yes" : "No",
                Day2    = Convert.ToBoolean(e["Day2"]),
                lblDay2 = "Mon",
                Mon     = e["Day2"].ToString().Contains("True") ? "Yes" : "No",
                Day3    = Convert.ToBoolean(e["Day3"]),
                lblDay3 = "Tue",
                Tue     = e["Day3"].ToString().Contains("True") ? "Yes" : "No",
                Day4    = Convert.ToBoolean(e["Day4"]),
                lblDay4 = "Wed",
                Wed     = e["Day4"].ToString().Contains("True") ? "Yes" : "No",
                Day5    = Convert.ToBoolean(e["Day5"]),
                lblDay5 = "Thu",
                Thu     = e["Day5"].ToString().Contains("True") ? "Yes" : "No",
                Day6    = Convert.ToBoolean(e["Day6"]),
                lblDay6 = "Fri",
                Fri     = e["Day6"].ToString().Contains("True") ? "Yes" : "No",
                Day7    = Convert.ToBoolean(e["Day7"]),
                lblDay7 = "Sat",
                Sat     = e["Day7"].ToString().Contains("True") ? "Yes" : "No",

                StartDate = Convert.ToDateTime(e["StartDate"]).ToString("dd-MMM-yyyy"),
                EndDate   = Convert.ToDateTime(e["EndDate"]).ToString("dd-MMM-yyyy"),

                ReleaseTime     = e["ReleaseTime"].ToString(),
                RemGrossWeight  = Convert.ToDecimal(e["GrossWeight"].ToString()),
                RemVolumeWeight = Convert.ToDecimal(e["VolumeWeight"].ToString()),
                AccountSNo      = "0",
                CreatedBy       = Convert.ToInt32(((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()),
                //AccountSNo =
                //BsaReference = e["BsaReference"].ToString(),
                //   IsActive = e["IsActive"] == "True" ? true : false
            });

            return(new KeyValuePair <string, List <AllocationAccount> >(ds.Tables[1].Rows[0][0].ToString(), AllocationAcList.AsQueryable().ToList()));
        }
Beispiel #2
0
        public AllocationAccount GetAllocationAccountRecord(string recordID, string UserID)
        {
            AllocationAccount AllocAC = new AllocationAccount();

            SqlParameter[] Parameters = { new SqlParameter("@SNo", recordID), new SqlParameter("@UserID", Convert.ToInt32(UserID)) };
            SqlDataReader  dr         = SqlHelper.ExecuteReader(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetRecordAllocationAccount", Parameters);

            if (dr.Read())
            {
                AllocAC.SNo = Convert.ToInt32(recordID.ToString());
                AllocAC.AccountAllocationCode = dr["AccountAllocationCode"].ToString();
                AllocAC.Remarks         = dr["Remarks"].ToString();
                AllocAC.AccountSNo      = dr["AccountSNo"].ToString();
                AllocAC.Text_AccountSNo = dr["Name"].ToString();
                AllocAC.AllocationCode  = dr["AllocationCode"].ToString();
                // AllocAC.AccountAllocationCode =dr["AllocationTransSNo"].ToString();
                AllocAC.Text_AllocationTransSNo = dr["Atsno"].ToString();
                AllocAC.ProductSNo               = dr["ProductSNo"].ToString();
                AllocAC.Text_ProductSNo          = dr["ProductName"].ToString();
                AllocAC.AllocationBlockType      = Convert.ToInt32(dr["AllocationBlockType"].ToString());
                AllocAC.Text_AllocationBlockType = "Soft Block";
                //AllocAC.Day1 = dr["Day1"].ToString() == "True" ? true : false;
                //AllocAC.Day2 = dr["Day2"].ToString() == "True" ? true : false;
                //AllocAC.Day3 = dr["Day3"].ToString() == "True" ? true : false;
                //AllocAC.Day4 = dr["Day4"].ToString() == "True" ? true : false;
                //AllocAC.Day5 = dr["Day5"].ToString() == "True" ? true : false;
                //AllocAC.Day6 = dr["Day6"].ToString() == "True" ? true : false;
                //AllocAC.Day7 = dr["Day7"].ToString() == "True" ? true : false;
                AllocAC.AllDays    = Convert.ToBoolean(dr["AllDays"]);
                AllocAC.lblAllDays = "Days";
                AllocAC.AllDay     = dr["AllDays"].ToString().Contains("1") ? "Yes" : "No";
                AllocAC.Day1       = Convert.ToBoolean(dr["Day1"]);
                AllocAC.lblDay1    = "Sun";
                AllocAC.Sun        = dr["Day1"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day2       = Convert.ToBoolean(dr["Day2"]);
                AllocAC.lblDay2    = "Mon";
                AllocAC.Mon        = dr["Day2"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day3       = Convert.ToBoolean(dr["Day3"]);
                AllocAC.lblDay3    = "Tue";
                AllocAC.Tue        = dr["Day3"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day4       = Convert.ToBoolean(dr["Day4"]);
                AllocAC.lblDay4    = "Wed";
                AllocAC.Wed        = dr["Day4"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day5       = Convert.ToBoolean(dr["Day5"]);
                AllocAC.lblDay5    = "Thu";
                AllocAC.Thu        = dr["Day5"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day6       = Convert.ToBoolean(dr["Day6"]);
                AllocAC.lblDay6    = "Fri";
                AllocAC.Fri        = dr["Day6"].ToString().Contains("True") ? "Yes" : "No";
                AllocAC.Day7       = Convert.ToBoolean(dr["Day7"]);
                AllocAC.lblDay7    = "Sat";
                AllocAC.Sat        = dr["Day7"].ToString().Contains("True") ? "Yes" : "No";

                AllocAC.StartDate    = Convert.ToDateTime(dr["StartDate"]).ToString("dd-MMM-yyyy");
                AllocAC.EndDate      = Convert.ToDateTime(dr["EndDate"]).ToString("dd-MMM-yyyy");
                AllocAC.GrossWeight  = Convert.ToDecimal(dr["GrossWeight"].ToString());
                AllocAC.VolumeWeight = Convert.ToDecimal(dr["VolumeWeight"].ToString());
                AllocAC.ReleaseTime  = dr["ReleaseTime"].ToString();
                AllocAC.BsaReference = dr["BsaReference"].ToString();
                AllocAC.IsActive     = dr["IsActive"] == "True" ? true : false;
                AllocAC.CreatedBy    = Convert.ToInt32(dr["CreatedBy"].ToString());
            }
            dr.Close();
            return(AllocAC);
        }