Exemplo n.º 1
0
        public List <IncomingCourierDetailsVM> GetCourierDetails(FormCollection fc, Guid companyId)
        {
            List <IncomingCourierDetailsVM> incomingCourierDetailsVMLst = new List <IncomingCourierDetailsVM>();
            int rowId = 0;

            for (int f = 0; f < fc.Count; f++)
            {
                string currentKey = fc.GetKey(f);
                if (currentKey.Contains("Date_" + rowId))
                {
                    IncomingCourierDetailsVM incomingCourierDetailsVM = new IncomingCourierDetailsVM();
                    incomingCourierDetailsVM.CompanyID       = companyId;
                    incomingCourierDetailsVM.Date            = DateTime.Parse(fc["Date_" + rowId]);
                    incomingCourierDetailsVM.SINo            = (fc["SINo_" + rowId]);
                    incomingCourierDetailsVM.Remarks         = fc["Remarks_" + rowId];
                    incomingCourierDetailsVM.DocDetail       = fc["DocDetail_" + rowId];
                    incomingCourierDetailsVM.FileName        = (fc["FileName_" + rowId]);
                    incomingCourierDetailsVM.FilePath        = (fc["FilePath_" + rowId]);
                    incomingCourierDetailsVM.MasterID        = Convert.ToInt32((fc["MasterID_" + rowId]));
                    incomingCourierDetailsVM.Qty             = Convert.ToDecimal(fc["Qty_" + rowId]);
                    incomingCourierDetailsVM.RefNo           = (fc["RefNo_" + rowId]);
                    incomingCourierDetailsVM.ArraySubItem    = fc["arraySubItem_" + rowId];
                    incomingCourierDetailsVM.IsSubDetail     = false;
                    incomingCourierDetailsVM.ParentDetailsID = 0;
                    incomingCourierDetailsVM.CreatedBy       = 12;
                    incomingCourierDetailsVM.CreationDate    = DateTime.Now;
                    incomingCourierDetailsVM.UpdatedBy       = 12;
                    incomingCourierDetailsVM.UpdatedDate     = DateTime.Now;
                    incomingCourierDetailsVM.SubDetails      = GetSubDetails(incomingCourierDetailsVM);
                    incomingCourierDetailsVMLst.Add(incomingCourierDetailsVM);
                }
                rowId++;
            }
            return(incomingCourierDetailsVMLst);
        }
Exemplo n.º 2
0
        public List <IncomingCourierSubDetailsVM> GetSubDetails(IncomingCourierDetailsVM incomingDetails)
        {
            List <IncomingCourierSubDetailsVM> subDetailsLst = new List <IncomingCourierSubDetailsVM>();
            string subItem = incomingDetails.ArraySubItem;

            subItem = subItem.Replace("$$Falcon$$", "#");
            string[] row  = subItem.Split('#');
            string   xrow = row[1];

            if (xrow.EndsWith("|"))
            {
                xrow = xrow.Substring(0, xrow.Length - 1);
            }

            string[] yrow = xrow.Split('|');
            for (var x = 0; x < yrow.Length; x++)
            {
                IncomingCourierSubDetailsVM subItems = new IncomingCourierSubDetailsVM();
                string[] batchrecords = Regex.Split(yrow[x], "&&");
                if (Convert.ToDecimal(batchrecords[1]) != 0)
                {
                    subItems.CompanyID       = incomingDetails.CompanyID;
                    subItems.Date            = incomingDetails.Date;
                    subItems.SINo            = incomingDetails.SINo;
                    subItems.Remarks         = batchrecords[2];
                    subItems.DocDetail       = batchrecords[2];
                    subItems.FileName        = batchrecords[2];
                    subItems.FilePath        = batchrecords[2];
                    subItems.MasterID        = incomingDetails.MasterID;
                    subItems.Qty             = Convert.ToDecimal(batchrecords[2]);
                    subItems.RefNo           = batchrecords[2];
                    subItems.ArraySubItem    = "";
                    subItems.IsSubDetail     = true;
                    subItems.ParentDetailsID = 0;
                    subItems.CreatedBy       = 12;
                    subItems.CreationDate    = DateTime.Now;
                    subItems.UpdatedBy       = 12;
                    subItems.UpdatedDate     = DateTime.Now;
                    subDetailsLst.Add(subItems);
                }
            }
            return(subDetailsLst);
        }