Beispiel #1
0
        public ActionResult __CutomerCollectionDetailsForAudit(string customerCode)
        {
            objLoginHelper = (LoginHelper)Session["LogInInformation"];

            string auditSeqNo = string.Empty;

            auditSeqNo = hraDal.ReadAuditSeqNumberAfterCheckFinishedDate(objLoginHelper.LocationCode);

            List <CustomerCollectionAdjustmentForAudit> lstCustomerCollection = new List <CustomerCollectionAdjustmentForAudit>();

            lstCustomerCollection = salesDal.ReadCustomerCollectionAdjustmentForAudit(customerCode, Helper.ConvertDateToYearMonth(objLoginHelper.MonthOpenForSales), auditSeqNo);

            if (lstCustomerCollection.Count > 0)
            {
                string           collectedEmployeeName = string.Empty, responsibleEmployeeName = string.Empty;
                Hrm_EmployeeInfo objEmployeeInfo = new Hrm_EmployeeInfo();

                objEmployeeInfo       = hraDal.ReadEmployeeInfo(lstCustomerCollection[0].CollectedByEmployeeID);
                collectedEmployeeName = objEmployeeInfo != null ? objEmployeeInfo.EmployeeName + " [" + lstCustomerCollection[0].CollectedByEmployeeID + "]" : string.Empty;

                objEmployeeInfo         = hraDal.ReadEmployeeInfo(lstCustomerCollection[0].ResponsibleEmployeeID);
                responsibleEmployeeName = objEmployeeInfo != null ? objEmployeeInfo.EmployeeName + " [" + lstCustomerCollection[0].ResponsibleEmployeeID + "]" : string.Empty;

                var v = from ss in lstCustomerCollection
                        select new CustomerCollectionAdjustmentForAudit
                {
                    SerialNo                = ss.SerialNo,
                    CollectionDate          = ss.CollectionDate,
                    RefMemoNo               = ss.RefMemoNo,
                    CollectionAmount        = ss.CollectionAmount,
                    CollectedByEmployeeID   = ss.CollectedByEmployeeID,
                    CollectedByEmployeeName = collectedEmployeeName,
                    AuditReason             = ss.AuditReason,
                    ResponsibleEmployeeID   = ss.ResponsibleEmployeeID,
                    ResponsibleEmployeeName = responsibleEmployeeName,
                    Remarks = ss.Remarks
                };

                lstCustomerCollection = v.ToList();
            }

            return(View(new GridModel <CustomerCollectionAdjustmentForAudit>
            {
                Data = lstCustomerCollection
            }));
        }