public DataTable[] GetInformationInHomeUI_BLL()
        {
            HomeDAL aHomeDAL = new HomeDAL();

            DataTable[] values = aHomeDAL.GetInformationInHomeUI_DAL();
            return(values);
        }
        public List <List <string> > Post(BookingDetail objbookingDetail)
        {
            List <List <string> > listarray = new List <List <string> >();

            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>OrderHistory</actionname>"
                          + "<agencyid>" + objbookingDetail.AgencyID + "</agencyid>"
                          + "<clientid>" + objbookingDetail.ClientID + "</clientid>"
                          + "<loguserid>" + objbookingDetail.UserId + "</loguserid>"
                          + "<isclassified>" + objbookingDetail.IsClassified + " </isclassified>"
                          + "</ebooking>";

                DataTable     objdt      = objHomeDAL.eBookingActions(strXml).Tables[0];
                List <String> columnlist = (from dc in objdt.Columns.Cast <DataColumn>()
                                            select dc.ColumnName).ToList();
                listarray.Add(columnlist);
                foreach (DataRow dr in objdt.Rows)
                {
                    listarray.Add(dr.ItemArray.Select(o => o.ToString()).ToList());
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayValidateAdController::Post:", ex);
            }
            return(listarray);
        }
        public List <List <string> > Post(BookingDetail objbookingDetail)
        {
            List <List <string> > listarray = new List <List <string> >();

            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>searchclient</actionname>"
                          + "<searchname>" + objbookingDetail.SearchClientName + "</searchname>"
                          + "<searchid>" + objbookingDetail.SearchClientID + "</searchid>"
                          + "<searchcity>" + objbookingDetail.SearchClientCity + "</searchcity>"
                          + "<searchaddress>" + objbookingDetail.SearchClientAddress + "</searchaddress>"
                          + "<searchcode>" + objbookingDetail.SearchClientOldCode + "</searchcode>"
                          + "<isclassified>" + objbookingDetail.IsClassified + "</isclassified>"
                          + "</ebooking>";

                DataTable     objdt      = objHomeDAL.eBookingActions(strXml).Tables[0];
                List <String> columnlist = (from dc in objdt.Columns.Cast <DataColumn>()
                                            select dc.ColumnName).ToList();
                listarray.Add(columnlist);
                foreach (DataRow dr in objdt.Rows)
                {
                    listarray.Add(dr.ItemArray.Select(o => o.ToString()).ToList());
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayValidateAdController::Post:", ex);
            }
            return(listarray);
        }
Пример #4
0
        public ActionResult Index()
        {
            if (Session["UsuarioAutenticado"] == null)
            {
                return(RedirectToAction("ValidarLogin", "Colaborador"));
            }
            ViewBag.Nome = ((Colaborador)Session["UsuarioAutenticado"]).Nome;

            var homeDal = new HomeDAL();

            ViewBag.QuantidadeChamado       = homeDal.RetornarQuantidadeChamados().QuantidadeChamado;
            ViewBag.QuantidadeClientes      = homeDal.RetornarQuantidadeClientes().QuantidadeClientes;
            ViewBag.QuantidadeColaboradores = homeDal.RetornarQuantidadeColaborador().QuantidadeColaboradores;

            return(View());
        }
Пример #5
0
        public IHttpActionResult Put(int Id, [FromBody] Home home)
        {
            try
            {
                if (Id != home.Id)
                {
                    return(BadRequest("Os IDs de identificação não podem ser diferentes"));
                }

                HomeDAL homeDAL = new HomeDAL();
                Home    homeOld = homeDAL.Get(home.Id);

                if (homeOld == null)
                {
                    return(NotFound());
                }

                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                homeOld.HomeStatusId = home.HomeStatusId;
                homeOld.DeliveryDate = home.DeliveryDate;
                homeOld.Block        = home.Block;
                homeOld.Apartment    = home.Apartment;

                if (home.HomeAddress != null)
                {
                    homeOld.HomeAddress.CityId     = home.HomeAddress.CityId;
                    homeOld.HomeAddress.Complement = home.HomeAddress.Complement;
                    homeOld.HomeAddress.District   = home.HomeAddress.District;
                    homeOld.HomeAddress.HomeNumber = home.HomeAddress.HomeNumber;
                    homeOld.HomeAddress.Street     = home.HomeAddress.Street;

                    new HomeAddressDAL().Update(homeOld.HomeAddress);
                }

                homeDAL.Update(homeOld);
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Пример #6
0
        public BookingDetail Post(BookingDetail objbookingDetail)
        {
            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>suspendorder</actionname><roid>" + objbookingDetail.ROID + "</roid>"
                          + "<orderlevel>" + objbookingDetail.OrderLevel + "</orderlevel>"
                          + "<loguserid>" + objbookingDetail.UserId + "</loguserid>"
                          + "<isclassified>" + objbookingDetail.IsClassified + " </isclassified>"
                          + "<insnum>" + objbookingDetail.InsNum + "</insnum>"
                          + "<peid>" + objbookingDetail.PEID + "</peid>"
                          + "<releaseid>" + objbookingDetail.ReleaseID + "</releaseid>"
                          + "<uom>" + objbookingDetail.UOMID + "</uom>"
                          + "<reasonid>" + objbookingDetail.SuspendReasonID + "</reasonid>"
                          + "<reasonremark>" + objbookingDetail.SuspendRemarks + "</reasonremark>"
                          + "</ebooking>";


                DataTable objdt = objHomeDAL.eBookingActions(strXml).Tables[0];
                if (objdt.Rows.Count > 0)
                {
                    objbookingDetail.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    if (objbookingDetail.IsValid == 1)
                    {
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    }
                    else
                    {
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayValidateAdController::Post:", ex);
            }
            return(objbookingDetail);
        }
Пример #7
0
        public IHttpActionResult Get(int Id)
        {
            try
            {
                Home home = new HomeDAL().Get(Id);

                if (home == null)
                {
                    return(NotFound());
                }

                IList <HomeStatus> homeStatus     = new HomeStatusDAL().List();
                HomeStatus         nextHomeStatus = null;

                int index = -1;

                for (int i = 0; i < homeStatus.Count; i++)
                {
                    if (homeStatus[i].Id == home.HomeStatusId)
                    {
                        index = ++i;
                        break;
                    }
                }

                if (index >= 0 && index < homeStatus.Count)
                {
                    nextHomeStatus = homeStatus[index];
                }

                return(Ok(new { Home = home, HomeStatus = homeStatus, nextHomeStatus }));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
        public BookingDetail Post(BookingDetail objbookingDetail)
        {
            string strXml = string.Empty;

            try
            {
                HomeDAL  objHomeDAL    = new HomeDAL();
                string   roids         = objbookingDetail.PendingROID;
                string[] selectedroids = roids.Split(',');

                strXml += "<ebooking><orderlevel><receiptetail>"
                          + "<agencyid>" + objbookingDetail.AgencyID + "</agencyid><clientid>" + objbookingDetail.ClientID + "</clientid>"
                          + "<casualclientname>" + objbookingDetail.CasualClientName + "</casualclientname><casualaddress>" + objbookingDetail.CasualClientAddress + "</casualaddress>"
                          + "<City>" + objbookingDetail.CasualClientCity + "</City><Phone>" + objbookingDetail.CasualClientPhoneNo + "</Phone><Zip>" + objbookingDetail.CasualClientZipCode + "</Zip>"
                          + "<revenuecentreid>" + objbookingDetail.RevenueCentreID + "</revenuecentreid><loguserid>" + objbookingDetail.UserId + "</loguserid>"
                          + "<totalamountreceivable>" + objbookingDetail.ReceivableAmount + "</totalamountreceivable>"
                          + "<receiptamount>" + objbookingDetail.TotalReceivable + "</receiptamount>"
                          + "<writeoffamount>" + objbookingDetail.WriteoffAmount + "</writeoffamount>"
                          + "<totalamountpaid>" + objbookingDetail.ReceiptAmount + "</totalamountpaid>"
                          + "<receiptdate>" + DateTime.Now.ToString("dd/MM/yyyy") + "</receiptdate>"
                          + "<saveflag>" + objbookingDetail.SaveFlag + "</saveflag>"
                          + "<receiptremarks></receiptremarks>";
                for (var i = 0; i < selectedroids.Length; i++)
                {
                    strXml += "<OrdersPaid>"
                              + "<ROID>" + selectedroids[i] + "</ROID>"
                              + "</OrdersPaid>";
                }
                if (objbookingDetail.Amount != 0)
                {
                    strXml += "<paymentdetail>"
                              + "<paymentmodeid>" + objbookingDetail.PaymentModeID + "</paymentmodeid><chequenumber>" + objbookingDetail.ChequeNumber + "</chequenumber><chequedate></chequedate>"
                              + "<amount>" + objbookingDetail.Amount + "</amount><bankid>" + objbookingDetail.BankID + "</bankid><bankname>" + objbookingDetail.BranchBankName + "</bankname>"
                              + "<branchid>" + objbookingDetail.BankNameID + "</branchid><branchname>" + objbookingDetail.BranchName + "</branchname>"
                              + "<bankbranchcode>" + objbookingDetail.BankName + "</bankbranchcode>"
                              + "<advanceamount>" + objbookingDetail.AdvanceAmount + "</advanceamount><advancereceiptid>" + objbookingDetail.AdvanceReceiptID + "</advancereceiptid>"
                              + "<advanceutilised>" + objbookingDetail.AdvanceUtilised + "</advanceutilised>"
                              + "</paymentdetail>";
                }
                if (objbookingDetail.Amount1 != 0)
                {
                    strXml += "<paymentdetail>"
                              + "<paymentmodeid>" + objbookingDetail.PaymentModeID1 + "</paymentmodeid><chequenumber>" + objbookingDetail.ChequeNumber1 + "</chequenumber><chequedate></chequedate>"
                              + "<amount>" + objbookingDetail.Amount1 + "</amount><bankid>" + objbookingDetail.BankID1 + "</bankid><bankname>" + objbookingDetail.BranchBankName1 + "</bankname>"
                              + "<branchid>" + objbookingDetail.BankNameID1 + "</branchid><branchname>" + objbookingDetail.BranchName1 + "</branchname>"
                              + "<bankbranchcode>" + objbookingDetail.BankName1 + "</bankbranchcode>"
                              + "<advanceamount>" + objbookingDetail.AdvanceAmount1 + "</advanceamount><advancereceiptid>" + objbookingDetail.AdvanceReceiptID1 + "</advancereceiptid>"
                              + "<advanceutilised>" + objbookingDetail.AdvanceUtilised1 + "</advanceutilised>"
                              + "</paymentdetail>";
                }
                if (objbookingDetail.Amount2 != 0)
                {
                    strXml += "<paymentdetail>"
                              + "<paymentmodeid>" + objbookingDetail.PaymentModeID2 + "</paymentmodeid><chequenumber>" + objbookingDetail.ChequeNumber2 + "</chequenumber><chequedate></chequedate>"
                              + "<amount>" + objbookingDetail.Amount2 + "</amount><bankid>" + objbookingDetail.BankID2 + "</bankid><bankname>" + objbookingDetail.BranchBankName2 + "</bankname>"
                              + "<branchid>" + objbookingDetail.BankNameID2 + "</branchid><branchname>" + objbookingDetail.BranchName2 + "</branchname>"
                              + "<bankbranchcode>" + objbookingDetail.BankName2 + "</bankbranchcode>"
                              + "<advanceamount>" + objbookingDetail.AdvanceAmount2 + "</advanceamount><advancereceiptid>" + objbookingDetail.AdvanceReceiptID2 + "</advancereceiptid>"
                              + "<advanceutilised>" + objbookingDetail.AdvanceUtilised2 + "</advanceutilised>"
                              + "</paymentdetail>";
                }
                strXml += "</receiptetail></orderlevel></ebooking>";

                DataTable objdt = objHomeDAL.BookNewReceiptXML(strXml).Tables[0];

                if (objdt.Rows.Count > 0)
                {
                    objbookingDetail.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    if (objbookingDetail.IsValid > 0)
                    {
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    }
                    else
                    {
                        objbookingDetail.ReceiptID    = Convert.ToInt64(objdt.Rows[0]["ReceiptID"]);
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportLogError("SP_Name::EBK_SP_CreateReceiptXML:", ex, strXml);
            }
            return(objbookingDetail);
        }
Пример #9
0
        public Dictionary <string, object> Post(BookingDetail objbookingDetail)
        {
            Dictionary <string, object> OrderDetails        = new Dictionary <string, object>();
            List <OpenOrder>            objListOpenOrder    = new List <OpenOrder>();
            List <ReceiptOrder>         objListReceiptOrder = new List <ReceiptOrder>();
            List <ROFilesOrder>         objListROFilesOrder = new List <ROFilesOrder>();
            OpenOrder objOpenOder;

            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>openbookingid</actionname><bookingid>" + objbookingDetail.BookingID + "</bookingid>"
                          + "<loguserid>" + objbookingDetail.UserId + "</loguserid>"
                          + "<logcentreid>" + objbookingDetail.RevenueCentreID + "</logcentreid>"
                          + "<isclassified>" + objbookingDetail.IsClassified + "</isclassified></ebooking>";
                DataSet objds = objHomeDAL.eBookingActions(strXml);

                if (objds.Tables.Count == 1)
                {
                    objOpenOder         = new OpenOrder();
                    objOpenOder.IsValid = Convert.ToInt16(objds.Tables[0].Rows[0]["ErrorFlag"]);
                    if (objOpenOder.IsValid == 1)
                    {
                        objOpenOder.ErrorMessage = Convert.ToString(objds.Tables[0].Rows[0]["ErrorMessage"]);
                        objOpenOder.IsValid      = Convert.ToInt16(objds.Tables[0].Rows[0]["ErrorFlag"]);
                        objListOpenOrder.Add(objOpenOder);
                        OrderDetails.Add("OpenOrder", objListOpenOrder);
                    }
                }
                else
                {
                    DataTable objdt  = objds.Tables[0];
                    DataTable objdt1 = objds.Tables[1];
                    DataTable objdt2 = objds.Tables[2];


                    if (objdt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in objdt.Rows)
                        {
                            objOpenOder = new OpenOrder();

                            objOpenOder.StartCol             = Convert.ToString(dr["StartCol"]);
                            objOpenOder.Yposition            = Convert.ToString(dr["Yposition"]);
                            objOpenOder.BoxNumber            = Convert.ToString(dr["BoxNumber"]);
                            objOpenOder.RevenueCentreID      = Convert.ToInt16(dr["RevenueCentreID"]);
                            objOpenOder.BookingCentreID      = Convert.ToInt16(dr["BookingCentreID"]);
                            objOpenOder.IsClassified         = Convert.ToInt16(dr["IsClassified"]);
                            objOpenOder.RODate               = Convert.ToString(dr["RODate"]);
                            objOpenOder.BookingDate          = Convert.ToDateTime(dr["BookingDate"]).ToString("dd/MM/yyyy HH:mm:ss.fff");
                            objOpenOder.BookingExecID        = Convert.ToInt16(dr["BookingExecID"]);
                            objOpenOder.BookingNumber        = Convert.ToString(dr["BookingNumber"]);
                            objOpenOder.RONumber             = Convert.ToString(dr["RONumber"]);
                            objOpenOder.AgencyID             = Convert.ToInt16(dr["AgencyID"]);
                            objOpenOder.ClientID             = Convert.ToInt16(dr["ClientID"]);
                            objOpenOder.AgentID              = Convert.ToInt16(dr["AgentID"]);
                            objOpenOder.CanvassorID          = Convert.ToInt16(dr["CanvassorID"]);
                            objOpenOder.ROType               = Convert.ToInt16(dr["ROType"]);
                            objOpenOder.BillingCycle         = Convert.ToInt16(dr["BillingCycle"]);
                            objOpenOder.BillTo               = Convert.ToInt16(dr["BillTo"]);
                            objOpenOder.BillType             = Convert.ToInt16(dr["BillType"]);
                            objOpenOder.PaymentModeID        = Convert.ToInt16(dr["PaymentMode"]);
                            objOpenOder.IsManualBilling      = Convert.ToInt16(dr["IsManualBilling"]);
                            objOpenOder.SourceOrder          = Convert.ToInt16(dr["SourceOrder"]);
                            objOpenOder.ROStatus             = Convert.ToInt16(dr["ROStatus"]);
                            objOpenOder.RateFieldChanged     = Convert.ToInt16(dr["RateFieldChanged"]);
                            objOpenOder.ProductID            = Convert.ToInt16(dr["ProductID"]);
                            objOpenOder.BrandID              = Convert.ToInt16(dr["BrandID"]);
                            objOpenOder.SMEID                = Convert.ToInt16(dr["SMEID"]);
                            objOpenOder.BoxTypeID            = Convert.ToInt16(dr["BoxTypeID"]);
                            objOpenOder.ROID                 = Convert.ToInt64(dr["ROID"]);
                            objOpenOder.BookingID            = Convert.ToInt64(dr["BookingID"]);
                            objOpenOder.InsNum               = Convert.ToInt16(dr["InsNum"]);
                            objOpenOder.PEID                 = Convert.ToInt16(dr["PEID"]);
                            objOpenOder.ReleaseID            = Convert.ToInt16(dr["ReleaseID"]);
                            objOpenOder.ProdPEID             = Convert.ToInt16(dr["ProdPEID"]);
                            objOpenOder.ProdReleaseID        = Convert.ToInt16(dr["ProdReleaseID"]);
                            objOpenOder.ScheduledDate        = Convert.ToDateTime(dr["ScheduledDate"]).ToString("dd/MM/yyyy");
                            objOpenOder.PackageID            = Convert.ToInt16(dr["PackageID"]);
                            objOpenOder.AdTypeID             = Convert.ToInt16(dr["AdTypeID"]);
                            objOpenOder.PremiaID             = Convert.ToInt16(dr["PremiaID"]);
                            objOpenOder.ColorID              = Convert.ToInt16(dr["Color"]);
                            objOpenOder.Status               = Convert.ToInt16(dr["Status"]);
                            objOpenOder.AuditStatus          = Convert.ToInt16(dr["AuditStatus"]);
                            objOpenOder.Free_or_Paid         = Convert.ToInt16(dr["Free_or_Paid"]);
                            objOpenOder.FreeAds              = Convert.ToInt16(dr["FreeAds"]);
                            objOpenOder.PaidAds              = Convert.ToInt16(dr["PaidAds"]);
                            objOpenOder.ItemRateFieldChanged = Convert.ToInt16(dr["ItemRateFieldChanged"]);
                            objOpenOder.RateCardID           = Convert.ToInt16(dr["RateCardID"]);
                            objOpenOder.AdRateID             = Convert.ToInt16(dr["AdRateID"]);
                            objOpenOder.CardRate             = Convert.ToDouble(dr["CardRate"]);
                            objOpenOder.CardAmount           = Convert.ToDouble(dr["CardAmount"]);
                            objOpenOder.AgreedRate           = Convert.ToDouble(dr["AgreedRate"]);
                            objOpenOder.AgreedAmount         = Convert.ToDouble(dr["AgreedAmount"]);
                            objOpenOder.PECardBaseRate       = Convert.ToDouble(dr["PECardBaseRate"]);
                            objOpenOder.ColorRate            = Convert.ToDouble(dr["PECardCOlourRate"]);
                            objOpenOder.PremiaRate           = Convert.ToDouble(dr["PECardPremiaRate"]);
                            objOpenOder.AgreedDiscPer        = Convert.ToDecimal(dr["AgreedDiscPer"]);
                            objOpenOder.AgreedDiscAmount     = Convert.ToDouble(dr["AgreedDiscAmount"]);
                            objOpenOder.CommissionPer        = Convert.ToDouble(dr["CommissionPer"]);
                            objOpenOder.CommissionAmount     = Convert.ToDouble(dr["CommissionAmount"]);
                            objOpenOder.DisCountColorPer     = Convert.ToDouble(dr["DisCountColorPer"]);
                            objOpenOder.DisCountPremiaPer    = Convert.ToDouble(dr["DisCountPremiaPer"]);
                            // objOpenOder.ExtraDiscountforPE = Convert.ToDouble(dr["ExtraDiscountforPE"]);
                            objOpenOder.ExtraChargesForPE     = Convert.ToDouble(dr["ExtraChargesForPE"]);
                            objOpenOder.ExtraChargesPer       = Convert.ToDouble(dr["ExtraChargesPer"]);
                            objOpenOder.ExtraDiscPer          = Convert.ToDouble(dr["ExtraDiscPer"]);
                            objOpenOder.ExtraDiscAmount       = Convert.ToDouble(dr["ExtraDiscAmount"]);
                            objOpenOder.ExtraBoxChargesPer    = Convert.ToDouble(dr["BoxChargesPer"]);
                            objOpenOder.ExtraBoxChargesAmount = Convert.ToDouble(dr["BoxChargesAmount"]);
                            objOpenOder.PreVATAmountforPE     = Convert.ToDouble(dr["PreVATAmountforPE"]);
                            objOpenOder.NetAmountforPE        = Convert.ToDouble(dr["NetAmountforPE"]);
                            objOpenOder.Net                       = Convert.ToDouble(dr["Net"]);
                            objOpenOder.Receivable                = Convert.ToDouble(dr["Receivable"]);
                            objOpenOder.VatPer                    = Convert.ToDouble(dr["VatPer"]);
                            objOpenOder.VatAmount                 = Convert.ToDouble(dr["VatAmount"]);
                            objOpenOder.WTPer                     = Convert.ToDouble(dr["WTPer"]);
                            objOpenOder.WTAmount                  = Convert.ToDouble(dr["WTAmount"]);
                            objOpenOder.MaterialID                = Convert.ToString(dr["MaterialID"]);
                            objOpenOder.AdsizeID                  = Convert.ToInt16(dr["AdsizeID"]);
                            objOpenOder.Adsize                    = Convert.ToString(dr["AdSize"]);
                            objOpenOder.AdSizeHeight              = Convert.ToDouble(dr["AdHeight"]);
                            objOpenOder.AdSizeWidth               = Convert.ToDouble(dr["AdColsize"]);
                            objOpenOder.BillableSize              = Convert.ToString(dr["BillableSize"]);
                            objOpenOder.BillableColSize           = Convert.ToDouble(dr["BillableColSize"]);
                            objOpenOder.BillableHeight            = Convert.ToDouble(dr["BillableHeight"]);
                            objOpenOder.BillableArea              = Convert.ToDouble(dr["BillableArea"]);
                            objOpenOder.UOM                       = Convert.ToInt16(dr["UOM"]);
                            objOpenOder.SchemeID                  = Convert.ToInt16(dr["SchemeID"]);
                            objOpenOder.SchemeDetailID            = Convert.ToInt16(dr["SchemedetailID"]);
                            objOpenOder.MaterialSource            = Convert.ToInt16(dr["MaterialSource"]);
                            objOpenOder.MaterialType              = Convert.ToInt16(dr["MaterialType"]);
                            objOpenOder.MaterialStatus            = Convert.ToInt16(dr["MaterialStatus"]);
                            objOpenOder.AgencyName                = Convert.ToString(dr["AgencyName"]);
                            objOpenOder.ClientName                = Convert.ToString(dr["ClientName"]);
                            objOpenOder.CasualClientName          = Convert.ToString(dr["CasualClientName"]);
                            objOpenOder.CanvassorName             = Convert.ToString(dr["CanvassorName"]);
                            objOpenOder.UserName                  = Convert.ToString(dr["UserName"]);
                            objOpenOder.CentreName                = Convert.ToString(dr["CentreName"]);
                            objOpenOder.MaterialPath              = Convert.ToString(dr["MaterialPath"]);
                            objOpenOder.JobPath                   = Convert.ToString(dr["JobPath"]);
                            objOpenOder.ROFilePath                = Convert.ToString(dr["ROFilePath"]);
                            objOpenOder.PkgIDs                    = Convert.ToString(dr["PkgIDs"]);
                            objOpenOder.PremiaName                = Convert.ToString(dr["PremiaName"]);
                            objOpenOder.SizeName                  = Convert.ToString(dr["SizeName"]);
                            objOpenOder.ColorName                 = Convert.ToString(dr["ColorName"]);
                            objOpenOder.CustomerTypeID            = Convert.ToInt16(dr["CasualRegularFlag"]);
                            objOpenOder.SchedulingInstructions    = Convert.ToString(dr["SchedulingInstructions"]);
                            objOpenOder.BillingInstruction        = Convert.ToString(dr["BillingInstruction"]);
                            objOpenOder.ProdInstructions          = Convert.ToString(dr["ProdInstructions"]);
                            objOpenOder.Caption                   = Convert.ToString(dr["Caption"]);
                            objOpenOder.CasualAddress             = Convert.ToString(dr["CasualAddress"]);
                            objOpenOder.CityID                    = Convert.ToInt32(dr["CityID"]);
                            objOpenOder.Zip                       = Convert.ToString(dr["Zip"]);
                            objOpenOder.Phone                     = Convert.ToString(dr["Phone"]);
                            objOpenOder.NicNumber                 = Convert.ToString(dr["NICNumber"]);
                            objOpenOder.VatNumber                 = Convert.ToString(dr["VATNumber"]);
                            objOpenOder.MBodyCount                = Convert.ToString(dr["MBodyCount"]);
                            objOpenOder.AdClassification          = Convert.ToString(dr["AdClassification"]);
                            objOpenOder.AdtypeID1                 = Convert.ToInt32(dr["Adtype1"]);
                            objOpenOder.AdtypeID2                 = Convert.ToInt32(dr["Adtype2"]);
                            objOpenOder.AdtypeID3                 = Convert.ToInt32(dr["Adtype3"]);
                            objOpenOder.AdtypeID4                 = Convert.ToInt32(dr["Adtype4"]);
                            objOpenOder.AllowCasualClient         = Convert.ToInt32(dr["AllowCasualClient"]);
                            objOpenOder.BoxAddress                = Convert.ToString(dr["BoxAddress"]);
                            objOpenOder.IsCD                      = Convert.ToInt32(dr["IsCD"]);
                            objOpenOder.StyleSheetID              = Convert.ToInt32(dr["StyleSheetID"]);
                            objOpenOder.IsLogo                    = Convert.ToInt32(dr["IsLogo"]);
                            objOpenOder.U_BodyText                = Convert.ToString(dr["U_BodyText"]);
                            objOpenOder.PECode                    = Convert.ToString(dr["PECode"]);
                            objOpenOder.AdStatus                  = Convert.ToString(dr["AdStatus"]);
                            objOpenOder.FileNames                 = Convert.ToString(dr["FileNames"]);
                            objOpenOder.ReasonForUnconfirmationID = Convert.ToString(dr["ReasonForUnconfirmationID"]);
                            objOpenOder.FileHeight                = Convert.ToString(dr["FileHeight"]);
                            objOpenOder.ReadOnlyFlag              = Convert.ToString(dr["ReadOnlyFlag"]);
                            objOpenOder.BlockB4ScheduledDate      = Convert.ToDateTime(dr["BlockB4ScheduledDate"]).ToString("dd/MM/yyyy");
                            objOpenOder.AdColumns                 = Convert.ToString(dr["CDADColumns"]);
                            objOpenOder.MaterialTypeDescription   = Convert.ToString(dr["MaterialTypeDescription"]);
                            objOpenOder.DeferredPayment           = Convert.ToInt16(dr["DeferredPayment"]);
                            objOpenOder.AgencyPaymentMode         = Convert.ToInt16(dr["AgencyPaymentMode"]);
                            objOpenOder.CompositeReceiptID        = Convert.ToString(dr["CompositeReceiptID"]);
                            objListOpenOrder.Add(objOpenOder);
                        }
                    }

                    ROFilesOrder objROFilesOrder;
                    if (objdt1.Rows.Count > 0)
                    {
                        foreach (DataRow dr in objdt1.Rows)
                        {
                            objROFilesOrder             = new ROFilesOrder();
                            objROFilesOrder.ROID        = Convert.ToInt64(dr["ROID"]);
                            objROFilesOrder.ROFileName  = Convert.ToString(dr["ROFileName"]);
                            objROFilesOrder.ROFileType  = Convert.ToString(dr["ROFileType"]);
                            objROFilesOrder.ROFileTitle = Convert.ToString(dr["ROFileTitle"]);
                            objListROFilesOrder.Add(objROFilesOrder);
                        }
                    }

                    ReceiptOrder objReceiptOder;
                    if (objdt2.Rows.Count > 0)
                    {
                        foreach (DataRow dr in objdt2.Rows)
                        {
                            objReceiptOder                    = new ReceiptOrder();
                            objReceiptOder.ReceiptID          = Convert.ToInt64(dr["ReceiptID"]);
                            objReceiptOder.ReceiptNumber      = Convert.ToInt64(dr["ReceiptNumber"]);
                            objReceiptOder.ReceiptPaymentMode = Convert.ToInt16(dr["PaymentMode"]);
                            objReceiptOder.BankID             = Convert.ToInt16(dr["BankID"]);
                            objReceiptOder.BranchID           = Convert.ToInt16(dr["BranchID"]);
                            objReceiptOder.CheckNumber        = Convert.ToString(dr["Number"]);
                            objReceiptOder.Amount             = Convert.ToDouble(dr["Amount"]);
                            objReceiptOder.TotalAmountPaid    = Convert.ToDouble(dr["TotalAmountPaid"]);
                            objReceiptOder.WriteOffAmount     = Convert.ToDouble(dr["WriteOffAmount"]);
                            objReceiptOder.CashRefund         = Convert.ToDouble(dr["CashRefund"]);
                            objReceiptOder.CashReceived       = Convert.ToDouble(dr["CashReceived"]);
                            objListReceiptOrder.Add(objReceiptOder);
                        }
                    }
                    OrderDetails.Add("OpenOrder", objListOpenOrder);
                    OrderDetails.Add("ROFilesOrder", objListROFilesOrder);
                    OrderDetails.Add("ReceiptOrder", objListReceiptOrder);
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayOpenOrderController::Post:", ex);
            }
            return(OrderDetails);
        }
Пример #10
0
        public BookingDetail Post(BookingDetail objbookingDetail)
        {
            string strXml = string.Empty;

            try
            {
                HomeDAL  objHomeDAL                      = new HomeDAL();
                string   dates                           = objbookingDetail.DateSelected;
                string[] selecteddate                    = dates.Split(',');
                string   packages                        = objbookingDetail.PackageID;
                string[] selectedpackages                = packages.Split(',');
                string   peids                           = objbookingDetail.PEID;
                string[] selectedpeids                   = peids.Split(',');
                string   adtypeids                       = objbookingDetail.AdtypeId;
                string[] selectedadtypeids               = adtypeids.Split(',');
                string   mattypeids                      = objbookingDetail.MaterialType;
                string[] selectedmattypeids              = mattypeids.Split(',');
                string   matsourceids                    = objbookingDetail.MaterialSource;
                string[] selectedmatsourceids            = matsourceids.Split(',');
                string   boxtypeids                      = objbookingDetail.BoxTypeID;
                string[] selectedboxtypeids              = boxtypeids.Split(',');
                string   uomids                          = objbookingDetail.UOMID;
                string[] selecteduomids                  = uomids.Split(',');
                string   statusids                       = objbookingDetail.Status;
                string[] selectedstatusids               = statusids.Split(',');
                string   cauditstatusids                 = objbookingDetail.AuditStatus;
                string[] selectedcauditstatusids         = cauditstatusids.Split(',');
                string   cardrates                       = objbookingDetail.CardRate;
                string[] selectedcardrates               = cardrates.Split(',');
                string   cardamounts                     = objbookingDetail.CardAmount;
                string[] selectedcardamounts             = cardamounts.Split(',');
                string   ratecardids                     = objbookingDetail.RateCardID;
                string[] selectedratecardids             = ratecardids.Split(',');
                string   adrateids                       = objbookingDetail.AdRateID;
                string[] selectedadrateids               = adrateids.Split(',');
                string   agreedrates                     = objbookingDetail.AgreedRate;
                string[] selectedagreedrates             = agreedrates.Split(',');
                string   agreedamounts                   = objbookingDetail.AgreedAmount;
                string[] selectedagreedamounts           = agreedamounts.Split(',');
                string   agreeddispers                   = objbookingDetail.AgreedDiscPer;
                string[] selectedagreeddispers           = agreeddispers.Split(',');
                string   agreeddisamounts                = objbookingDetail.AgreedDiscAmount;
                string[] selectedagreeddisamounts        = agreeddisamounts.Split(',');
                string   prevatamounts                   = objbookingDetail.PreVATAmount;
                string[] selectedprevatamounts           = prevatamounts.Split(',');
                string   vatapers                        = objbookingDetail.VATPer;
                string[] selectedvatapers                = vatapers.Split(',');
                string   vatamounts                      = objbookingDetail.VATAmount;
                string[] selectedvatamounts              = vatamounts.Split(',');
                string   agencycommissionpers            = objbookingDetail.AgencyCommissionPer;
                string[] selectedagencycommissionpers    = agencycommissionpers.Split(',');
                string   agencycommissionamounts         = objbookingDetail.AgencyCommissionAmount;
                string[] selectedagencycommissionamounts = agencycommissionamounts.Split(',');
                string   schemeids                       = objbookingDetail.SchemeID;
                string[] selecteschemeids                = schemeids.Split(',');
                string   schemedetailids                 = objbookingDetail.SchemeDetailID;
                string[] selectedschemedetailids         = schemedetailids.Split(',');
                string   extrachargespers                = objbookingDetail.ExtraChargesPer;
                string[] selectedextrachargespers        = extrachargespers.Split(',');
                string   extrachargesamounts             = objbookingDetail.ExtraChargesAmount;
                string[] selectedextrachargesamounts     = extrachargesamounts.Split(',');
                string   extradiscpers                   = objbookingDetail.ExtraDiscPer;
                string[] selectedextradiscpers           = extradiscpers.Split(',');
                string   extradiscamount                 = objbookingDetail.ExtraDiscAmount;
                string[] selectedextradiscamount         = extradiscamount.Split(',');
                string   extraboxchargespers             = objbookingDetail.ExtraBoxChargesPer;
                string[] selectedextraboxchargespers     = extraboxchargespers.Split(',');
                string   extraboxchargesamounts          = objbookingDetail.ExtraBoxChargesAmount;
                string[] selectedextraboxchargesamounts  = extraboxchargesamounts.Split(',');
                string   receivableamounts               = objbookingDetail.Receivable;
                string[] selectedreceivableamounts       = receivableamounts.Split(',');
                string   packageids                      = string.Empty;
                int      totalrecordreturn               = Convert.ToInt16(objbookingDetail.TotalRecordReturn);

                int      FileLength  = Convert.ToInt16(objbookingDetail.FileLength);
                string[] rofilename  = { };
                string[] rofiletype  = { };
                string[] rofiletitle = { };
                if (FileLength != 0)
                {
                    string filename = objbookingDetail.RoFileName;
                    rofilename = filename.Split(',');
                    string filetype = objbookingDetail.RoFileType;
                    rofiletype = filetype.Split(',');
                    string filetitle = objbookingDetail.RoFileTitle;
                    rofiletitle = filetitle.Split(',');
                }

                if (selectedpackages.Length == 1)
                {
                    packageids = objbookingDetail.PackageID;
                }
                else
                {
                    packageids = "0";
                }

                if (selecteddate.Length > 0)
                {
                    strXml += "<ebooking>"
                              + "<orderlevel>"
                              + "<roid>" + objbookingDetail.ROID + "</roid>"
                              + "<bookingdate>" + objbookingDetail.BookingDate + "</bookingdate>"
                              + "<revenuecentreid>" + objbookingDetail.RevenueCentreID + "</revenuecentreid>"
                              + "<bookingcentreid>" + objbookingDetail.BookingCentreID + "</bookingcentreid>"
                              + "<bookingexecid>" + objbookingDetail.UserId + "</bookingexecid>"
                              + "<ronumber>" + objbookingDetail.RONumber + "</ronumber>"
                              + "<agencyid>" + objbookingDetail.AgencyID + "</agencyid>"
                              + "<clientid>" + objbookingDetail.ClientID + "</clientid>"
                              + "<canvassorid>" + objbookingDetail.CanvassorID + "</canvassorid>"
                              + "<loguserid>" + objbookingDetail.UserId + "</loguserid>"
                              + "<isclassified>" + objbookingDetail.IsClassified + "</isclassified>"
                              + "<sourceroid>" + objbookingDetail.SourceROID + "</sourceroid>"
                              + "<ratefieldchanged>" + objbookingDetail.RateFieldChanged + "</ratefieldchanged>"

                              + "<casualclientname>" + objbookingDetail.CasualClientName + "</casualclientname>"
                              + "<casualclientaddress>" + objbookingDetail.CasualClientAddress + "</casualclientaddress>"
                              + "<contactperson>" + objbookingDetail.ContactPerson + "</contactperson>"
                              + "<casualclientcity>" + objbookingDetail.CasualClientCity + "</casualclientcity>"
                              + "<casualclientzipcode>" + objbookingDetail.CasualClientZipCode + "</casualclientzipcode>"
                              + "<casualclientphoneno>" + objbookingDetail.CasualClientPhoneNo + "</casualclientphoneno>"
                              + "<casualcontactperson>" + objbookingDetail.CasualContactPerson + "</casualcontactperson>"
                              + "<casualclientnicnumber>" + objbookingDetail.CasualClientNicNumber + "</casualclientnicnumber>"
                              + "<casualclientvatnumber>" + objbookingDetail.CasualClientVatNumber + "</casualclientvatnumber>"
                              + "<casualclientemailid>" + objbookingDetail.CasualClientEmailID + "</casualclientemailid>"
                              + "<casualclientpassword>" + objbookingDetail.CasualClientPassword + "</casualclientpassword>"

                              + "<totalorders>" + objbookingDetail.TotalOrders + "</totalorders>"
                              + "<smeid>" + objbookingDetail.SMEID + "</smeid>"
                              + "<productid>" + objbookingDetail.ProductID + "</productid>"
                              + "<brandid>" + objbookingDetail.BrandID + "</brandid>"
                              + "<rotype>" + objbookingDetail.ROType + "</rotype>"
                              + "<reasonforunconfirmationid>" + objbookingDetail.UnConfirmReason + "</reasonforunconfirmationid>"
                              + "<billtype>" + objbookingDetail.BillType + "</billtype>"
                              + "<ordernumber>" + objbookingDetail.OrderNumber + "</ordernumber>"
                              + "<uniquenumber>" + objbookingDetail.UniqueCode + "</uniquenumber>"
                              + "<customertype>" + objbookingDetail.CustomerTypeID + "</customertype>"
                              + "<paymentmode>" + objbookingDetail.PaymentTypeID + "</paymentmode>"
                              + "<ismanualbilling>" + objbookingDetail.IsManualBilling + "</ismanualbilling>"
                              + "<rostatus>" + objbookingDetail.ROStatus + "</rostatus>"
                              + "<packagelist>" + objbookingDetail.PackageID + "</packagelist>"
                              + "<billinginstruction>" + objbookingDetail.BillingIns + "</billinginstruction>"
                              + "<receivableamount>" + objbookingDetail.ReceivableAmount + "</receivableamount>"
                              + "<saveflag>" + objbookingDetail.SaveFlag + "</saveflag>"
                              + "<machineid>" + objbookingDetail.MachineID + "</machineid>"
                              + "<machinename>" + objbookingDetail.MachineName + "</machinename>"
                              + "<deferredpayment>" + objbookingDetail.CheckDifferValue + "</deferredpayment>";

                    // new code
                    for (var i = 0; i < totalrecordreturn; i++)   // selecteddate.Length
                    {
                        var date = objbookingDetail.list[i].ScheduledDate.Substring(0, 10);
                        strXml += "<insertlevel>"
                                  + "<insnum>" + objbookingDetail.list[i].InsNum + "</insnum>"
                                  + "<packageid>" + packageids + "</packageid>"
                                  + "<no_of_insertions>" + selecteddate.Length + "</no_of_insertions>"
                                  + "<invoicenum>0</invoicenum>";
                        var peid = objbookingDetail.list[i].PEID;
                        strXml += "<itemlevel>"
                                  + "<peid>" + peid + "</peid>"
                                  + "<caption>" + objbookingDetail.Caption + "</caption>"
                                  + "<schedulinginstructions>" + objbookingDetail.SchedulingIns + "</schedulinginstructions>"
                                  + "<prodinstructions>" + objbookingDetail.ProdInstructions + "</prodinstructions>"
                                  + "<adtypeid>" + objbookingDetail.list[i].AdTypeID + "</adtypeid>";
                        strXml += "<adtype1>" + objbookingDetail.list[i].AdtypeID1 + "</adtype1>"
                                  + "<adtype2>" + objbookingDetail.list[i].AdtypeID2 + "</adtype2>"
                                  + "<adtype3>" + objbookingDetail.list[i].AdtypeID3 + "</adtype3>"
                                  + "<adtype4>" + objbookingDetail.list[i].AdtypeID4 + "</adtype4>"
                                  + "<materialid>" + objbookingDetail.list[i].MaterialID + "</materialid>";
                        strXml += "<stylesheetid>" + objbookingDetail.list[i].StyleSheetID + "</stylesheetid>"
                                  + "<iscd>" + objbookingDetail.IsCD + "</iscd>"
                                  + "<islogo>" + objbookingDetail.IsLogo + "</islogo>"
                                  + "<filenames>" + objbookingDetail.FileNames + "</filenames>"
                                  + "<publishstatus>0</publishstatus>"
                                  + "<mbodychanged>" + objbookingDetail.MBodyChange + "</mbodychanged>"
                                  + "<bodycount>" + objbookingDetail.TotalWords + "</bodycount>"
                                  + "<mbodycount>" + objbookingDetail.MBodyCount + "</mbodycount>"
                                  + "<charcount>" + objbookingDetail.CharCount + "</charcount>"
                                  + "<headeradtext></headeradtext>"
                                  + "<bodytext>" + objbookingDetail.AdText + "</bodytext>"
                                  + "<footertext></footertext>"
                                  + "<materialtype>" + objbookingDetail.MaterialType + "</materialtype>"
                                  + "<materialsource>" + objbookingDetail.MaterialSource + "</materialsource>"
                                  + "<boxtypeid>" + objbookingDetail.BoxTypeID + "</boxtypeid>"
                                  + "<boxaddress>" + objbookingDetail.BoxAddress + "</boxaddress>"
                                  + "<releaseid>0</releaseid>"
                                  + "<scheduleddate>" + date + "</scheduleddate>"
                                  + "<free_or_paid>1</free_or_paid>"
                                  + "<uom>" + objbookingDetail.list[i].UOM + "</uom>"
                                  + "<ratecardid>" + objbookingDetail.list[i].RateCardID + "</ratecardid>"
                                  + "<adrateid>" + objbookingDetail.list[i].AdRateID + "</adrateid>"
                                  + "<status>" + objbookingDetail.list[i].Status + "</status>"
                                  + "<auditstatus>" + objbookingDetail.list[i].AuditStatus + "</auditstatus>"
                                  + "<paymentstatus>0</paymentstatus>"
                                  + "<materialstatus>0</materialstatus>";
                        strXml += "<cardrate>" + objbookingDetail.list[i].CardRate + "</cardrate>"
                                  + "<cardamount>" + objbookingDetail.list[i].CardAmount + "</cardamount>"
                                  + "<itemratefieldchanged>" + objbookingDetail.list[i].ItemRateFieldChanged + "</itemratefieldchanged>"
                                  + "<agreedrate>" + objbookingDetail.list[i].AgreedRate + "</agreedrate>"
                                  + "<agreedamount>" + objbookingDetail.list[i].AgreedAmount + "</agreedamount>"
                                  + "<agreeddiscount>" + objbookingDetail.list[i].AgreedDiscAmount + "</agreeddiscount>"
                                  + "<agreeddisper>" + objbookingDetail.list[i].AgreedDiscPer + "</agreeddisper>"
                                  + "<prevatamountforpe>" + objbookingDetail.list[i].PreVATAmount + "</prevatamountforpe>"
                                  + "<netamountforpe>" + objbookingDetail.list[i].Receivable + "</netamountforpe>"
                                  + "<pevatper>" + objbookingDetail.list[i].VATPer + "</pevatper>"
                                  + "<pevatamount>" + objbookingDetail.list[i].VATAmount + "</pevatamount>"
                                  + "<extrachargesper>" + objbookingDetail.list[i].ExtraChargesPer + "</extrachargesper>"
                                  + "<extrachargesforpe>" + objbookingDetail.list[i].ExtraChargesAmount + "</extrachargesforpe>"
                                  + "<extradiscper>" + objbookingDetail.list[i].ExtraDiscPer + "</extradiscper>"
                                  + "<extradiscountforpe>" + objbookingDetail.list[i].ExtraDiscAmount + "</extradiscountforpe>"
                                  + "<extraboxchargesper>" + selectedextraboxchargespers[i] + "</extraboxchargesper>"
                                  + "<extraboxchargesamount>" + objbookingDetail.list[i].ExtraBoxChargesAmount + "</extraboxchargesamount>"
                                  + "<commissionper>" + objbookingDetail.list[i].AgencyCommissionPer + "</commissionper>"
                                  + "<commissionamount>" + objbookingDetail.list[i].AgencyCommissionAmount + "</commissionamount>";

                        strXml += "<schemeid>" + objbookingDetail.list[i].SchemeID + "</schemeid>"
                                  + "<schemedetailid>" + objbookingDetail.list[i].SchemeDetailID + "</schemedetailid>"
                                  + "<adcolumns>" + objbookingDetail.ClassifiedCol + "</adcolumns>"
                                  + "<fileheight>" + objbookingDetail.LogoHeight + "</fileheight>"
                                  + "<adsize>" + objbookingDetail.AdsizeHeight + "*" + objbookingDetail.AdsizeWidth + "</adsize>"
                                  + "<adheight>" + objbookingDetail.AdsizeHeight + "</adheight>"
                                  + "<adwidth>" + objbookingDetail.AdsizeWidth + "</adwidth>"
                                  + "<adarea>" + Convert.ToDouble(objbookingDetail.AdsizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</adarea>"
                                  + "<billablesize>" + objbookingDetail.AdsizeHeight + "*" + objbookingDetail.AdsizeWidth + "</billablesize>"
                                  + "<billableheight>" + objbookingDetail.AdsizeHeight + "</billableheight>"
                                  + "<billablewidth>" + objbookingDetail.AdsizeWidth + "</billablewidth>"
                                  + "<billablearea>" + Convert.ToDouble(objbookingDetail.AdsizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</billablearea>"
                                  + "<boxnumber>" + objbookingDetail.list[i].BoxNumber + "</boxnumber>"
                                  + "<startcol>" + objbookingDetail.list[i].StartCol + "</startcol>"
                                  + "<yposition>" + objbookingDetail.list[i].Yposition + "</yposition>"
                                  + "</itemlevel>";
                        strXml += "</insertlevel>";
                    }
                    if (objbookingDetail.PaymentTypeID == 1 && objbookingDetail.CheckDifferValue == 0)
                    {
                        strXml += "<receiptetail>"
                                  + "<receiptamount>" + objbookingDetail.TotalReceivable + "</receiptamount>"
                                  + "<totalamountpaid>" + objbookingDetail.ReceiptAmount + "</totalamountpaid>"
                                  + "<writeoffamount>" + objbookingDetail.WriteoffAmount + "</writeoffamount>"
                                  + "<receiptdate>" + DateTime.Now.ToString("dd/MM/yyyy") + "</receiptdate>";
                        if (objbookingDetail.Amount != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        if (objbookingDetail.Amount1 != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID1 + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber1 + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount1 + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID1 + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName1 + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID1 + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName1 + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName1 + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        if (objbookingDetail.Amount2 != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID2 + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber2 + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount2 + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID2 + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName2 + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID2 + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName2 + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName2 + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        strXml += "</receiptetail>";
                    }
                    strXml += "<rofiles>"
                              + "<roid>" + objbookingDetail.ROID + "</roid>"
                              + "<loguserid>" + objbookingDetail.UserId + "</loguserid>";
                    if (FileLength == 0)
                    {
                        strXml += "<rofiledetail>"
                                  + "<rofilename></rofilename>"
                                  + "<rofiletype></rofiletype>"
                                  + "<rofiletitle></rofiletitle>"
                                  + "<isprinted>0</isprinted>"
                                  + "<portedflag>0</portedflag>"
                                  + "</rofiledetail>";
                    }
                    else
                    {
                        for (var k = 0; k < FileLength; k++)
                        {
                            strXml += "<rofiledetail>"
                                      + "<rofilename>" + rofilename[k] + "</rofilename>"
                                      + "<rofiletype>" + rofiletype[k] + "</rofiletype>"
                                      + "<rofiletitle>" + rofiletitle[k] + "</rofiletitle>"
                                      + "<isprinted>0</isprinted>"
                                      + "<portedflag>0</portedflag>"
                                      + "</rofiledetail>";
                        }
                    }
                    strXml += "</rofiles>";
                    strXml += "</orderlevel></ebooking>";
                }

                DataTable objdt = objHomeDAL.BookOrdersXML(strXml).Tables[0];
                if (objdt.Rows.Count > 0)
                {
                    objbookingDetail.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    //if (objbookingDetail.IsValid == 1 || objbookingDetail.IsValid == 2 || objbookingDetail.IsValid == 3 || objbookingDetail.IsValid == -2)
                    if (objbookingDetail.IsValid > 0)
                    {
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    }
                    else
                    {
                        objbookingDetail.ROID         = Convert.ToInt64(objdt.Rows[0]["ROID"]);
                        objbookingDetail.ReceiptID    = Convert.ToInt64(objdt.Rows[0]["ReceiptID"]);
                        objbookingDetail.JobSequence  = Convert.ToString(objdt.Rows[0]["JobSequence"]);
                        objbookingDetail.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                        objbookingDetail.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportLogError("SP_Name::EBK_SP_BookOrdersXML:", ex, strXml);
            }
            return(objbookingDetail);
        }
Пример #11
0
        public IEnumerable <PrintReceipt> Post(BookingDetail objbookingDetail)
        {
            Dictionary <string, object> OrderDetails        = new Dictionary <string, object>();
            List <PrintReceipt>         objListPrintReceipt = new List <PrintReceipt>();
            PrintReceipt objPrintReceipt;

            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>printreceipt</actionname><receiptid>" + objbookingDetail.ReceiptID + "</receiptid></ebooking>";
                DataTable objdt = objHomeDAL.eBookingActions(strXml).Tables[0];

                if (objdt.Rows.Count > 0)
                {
                    //objOpenOder.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    //if (objOpenOder.IsValid == 1)
                    //{
                    //    objOpenOder.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                    //    objOpenOder.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    //    objListOpenOrder.Add(objOpenOder);
                    //    OrderDetails.Add("OpenOrder", objListOpenOrder);
                    //}
                    //else
                    //{
                    foreach (DataRow dr in objdt.Rows)
                    {
                        objPrintReceipt = new PrintReceipt();
                        objPrintReceipt.OrderReceiptNo  = Convert.ToString(dr["OrderReceiptNo"]);
                        objPrintReceipt.ClientName      = Convert.ToString(dr["ClientName"]);
                        objPrintReceipt.Address         = Convert.ToString(dr["Address"]);
                        objPrintReceipt.City            = Convert.ToString(dr["City"]);
                        objPrintReceipt.Phone           = Convert.ToString(dr["Phone"]);
                        objPrintReceipt.Zip             = Convert.ToString(dr["Zip"]);
                        objPrintReceipt.BookedBy        = Convert.ToString(dr["BookedBy"]);
                        objPrintReceipt.BookedBy        = Convert.ToString(dr["BookedBy"]);
                        objPrintReceipt.REVISION_NUMBER = Convert.ToString(dr["REVISION_NUMBER"]);
                        objPrintReceipt.IsClassified    = Convert.ToString(dr["isClassified"]);
                        objPrintReceipt.VATNumber       = Convert.ToString(dr["VATNumber"]);
                        objPrintReceipt.Premia          = Convert.ToString(dr["Premia"]);
                        objPrintReceipt.Size            = Convert.ToString(dr["Size"]);
                        objPrintReceipt.Publication     = Convert.ToString(dr["Publication"]);
                        objPrintReceipt.AdTypeName      = Convert.ToString(dr["AdTypeName"]);
                        objPrintReceipt.Pubdate         = Convert.ToString(dr["Pubdate"]);
                        objPrintReceipt.Cost            = Convert.ToString(dr["Cost"]);
                        objPrintReceipt.VatAmount       = Convert.ToString(dr["VatAmount"]);
                        objPrintReceipt.Total           = Convert.ToString(dr["Total"]);
                        objPrintReceipt.Date            = Convert.ToString(dr["Date"]);
                        objPrintReceipt.AgencyName      = Convert.ToString(dr["AgencyName"]);
                        objPrintReceipt.AgencyCode      = Convert.ToString(dr["AgencyCode"]);
                        objPrintReceipt.Category1       = Convert.ToString(dr["Category1"]);
                        objPrintReceipt.Category2       = Convert.ToString(dr["Category2"]);
                        objPrintReceipt.Material        = Convert.ToString(dr["Material"]);
                        objListPrintReceipt.Add(objPrintReceipt);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("PrintReceiptController::Post:", ex);
            }
            return(objListPrintReceipt);
        }
Пример #12
0
        public List <HomeModel> Homeinvestment()
        {
            HomeDAL home = new HomeDAL();

            return(home.Homeinvestment());
        }
Пример #13
0
 public CountController()
 {
     homeDAL = new HomeDAL(DbProvider);
 }
        public IEnumerable <CSRateCalculation> Post(BookingDetail objbookingDetail)
        {
            List <CSRateCalculation> objListRate = new List <CSRateCalculation>();

            try
            {
                HomeDAL  objHomeDAL              = new HomeDAL();
                string   strXml                  = string.Empty;
                string   dates                   = objbookingDetail.DateSelected;
                string[] selecteddate            = dates.Split(',');
                string   packages                = objbookingDetail.PackageID;
                string[] selectedpackages        = packages.Split(',');
                string   peids                   = objbookingDetail.PEID;
                string[] selectedpeids           = peids.Split(',');
                string   packageids              = string.Empty;
                string   statusids               = objbookingDetail.Status;
                string[] selectedstatusids       = statusids.Split(',');
                string   cauditstatusids         = objbookingDetail.AuditStatus;
                string[] selectedcauditstatusids = cauditstatusids.Split(',');
                int      totalrecordreturn       = objbookingDetail.list.Count;
                if (selectedpackages.Length == 1)
                {
                    packageids = objbookingDetail.PackageID;
                }
                else
                {
                    packageids = "0";
                }

                if (selecteddate.Length > 0)
                {
                    strXml += "<ebooking>"
                              + "<orderlevel>"
                              + "<roid>" + objbookingDetail.ROID + "</roid>"
                              + "<bookingdate>" + objbookingDetail.BookingDate + "</bookingdate>"
                              + "<revenuecentreid>" + objbookingDetail.RevenueCentreID + "</revenuecentreid>"
                              + "<bookingcentreid>" + objbookingDetail.BookingCentreID + "</bookingcentreid>"
                              + "<ratecentreid>" + objbookingDetail.RevenueCentreID + "</ratecentreid>"
                              + "<bookingexecid>" + objbookingDetail.UserId + "</bookingexecid>"
                              + "<ronumber>" + objbookingDetail.RONumber + "</ronumber>"
                              + "<agencyid>" + objbookingDetail.AgencyID + "</agencyid>"
                              + "<clientid>" + objbookingDetail.ClientID + "</clientid>"
                              + "<ccname>" + objbookingDetail.ClientName + "</ccname>"
                              + "<ccvatnumber>" + objbookingDetail.ClientVatNum + "</ccvatnumber>"
                              //+ "<adflag>1</adflag>"
                              //+ "<rateflag>0</rateflag>"
                              + "<packageid>" + packageids + "</packageid>"
                              + "<packagelist>" + objbookingDetail.PackageID + "</packagelist>"
                              + "<productid>" + objbookingDetail.ProductID + "</productid>"
                              + "<totalinsertions>" + selecteddate.Length + "</totalinsertions>"
                              + "<uom>" + objbookingDetail.UOMID + "</uom>"
                              + "<isclassified>" + objbookingDetail.IsClassified + "</isclassified>"
                              + "<ratefieldchanged>" + objbookingDetail.RateFieldChanged + "</ratefieldchanged>"
                              + "<boxtypeid>" + objbookingDetail.BoxTypeID + "</boxtypeid>"
                              + "<paymentmode>" + objbookingDetail.PaymentTypeID + "</paymentmode>"
                              + "<ismanualbilling>" + objbookingDetail.IsManualBilling + "</ismanualbilling>";

                    for (var i = 0; i < totalrecordreturn; i++)
                    {
                        var date = objbookingDetail.list[i].ScheduledDate.Substring(0, 10);
                        strXml += "<insertlevel>"
                                  + "<insnum>" + objbookingDetail.list[i].InsNum + "</insnum>"
                                  + "<invoicenum>0</invoicenum>";
                        var peid = objbookingDetail.list[i].PEID;
                        strXml += "<itemlevel>"
                                  + "<peid>" + peid + "</peid>"
                                  + "<status>" + objbookingDetail.list[i].Status + "</status>"
                                  + "<auditstatus>" + objbookingDetail.list[i].AuditStatus + "</auditstatus>"
                                  + "<paymentstatus>0</paymentstatus>"
                                  + "<materialstatus>0</materialstatus>"
                                  + "<adtypeid>" + objbookingDetail.AdtypeId + "</adtypeid>";

                        strXml += "<adtype1>" + objbookingDetail.list[i].AdtypeID1 + "</adtype1>"
                                  + "<adtype2>" + objbookingDetail.list[i].AdtypeID2 + "</adtype2>"
                                  + "<adtype3>" + objbookingDetail.list[i].AdtypeID3 + "</adtype3>"
                                  + "<adtype4>" + objbookingDetail.list[i].AdtypeID4 + "</adtype4>"
                                  + "<stylesheetid>" + objbookingDetail.list[i].StyleSheetID + "</stylesheetid>"
                                  + "<materialid>" + objbookingDetail.list[i].MaterialID + "</materialid>";

                        strXml += "<iscd>" + objbookingDetail.IsCD + "</iscd>"
                                  + "<islogo>" + objbookingDetail.IsLogo + "</islogo>";
                        if (objbookingDetail.IsCD == 0)
                        {
                            strXml += "<totalwords>" + objbookingDetail.list[i].TotalWords + "</totalwords>"
                                      + "<mbodycount>" + objbookingDetail.list[i].MBodyCount + "</mbodycount>"
                                      + "<charcount>" + objbookingDetail.list[i].CharCount + "</charcount>"
                                      + "<bodytext>" + objbookingDetail.list[i].U_BodyText + "</bodytext>";
                        }
                        else
                        {
                            strXml += "<totalwords>" + objbookingDetail.TotalWords + "</totalwords>"
                                      + "<mbodycount>" + objbookingDetail.MBodyCount + "</mbodycount>"
                                      + "<charcount>" + objbookingDetail.CharCount + "</charcount>"
                                      + "<bodytext>" + objbookingDetail.AdText + "</bodytext>";
                        }
                        strXml += "<releaseid>0</releaseid>"
                                  + "<scheduleddate>" + date + "</scheduleddate>"
                                  + "<adcolumns>" + objbookingDetail.ClassifiedCol + "</adcolumns>"
                                  + "<fileheight>" + objbookingDetail.LogoHeight + "</fileheight>";
                        if (objbookingDetail.IsCD == 0)
                        {
                            strXml += "<adsize>" + objbookingDetail.list[i].AdSizeHeight + "*" + objbookingDetail.AdsizeWidth + "</adsize>"
                                      + "<adheight>" + objbookingDetail.list[i].AdSizeHeight + "</adheight>"
                                      + "<adwidth>" + objbookingDetail.AdsizeWidth + "</adwidth>"
                                      + "<adarea>" + Convert.ToDouble(objbookingDetail.list[i].AdSizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</adarea>"
                                      + "<billablesize>" + objbookingDetail.list[i].AdSizeHeight + "*" + objbookingDetail.AdsizeWidth + "</billablesize>"
                                      + "<billableheight>" + objbookingDetail.list[i].AdSizeHeight + "</billableheight>"
                                      + "<billablewidth>" + objbookingDetail.AdsizeWidth + "</billablewidth>"
                                      + "<billablearea>" + Convert.ToDouble(objbookingDetail.list[i].AdSizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</billablearea>";
                        }
                        else
                        {
                            strXml += "<adsize>" + objbookingDetail.AdsizeHeight + "*" + objbookingDetail.AdsizeWidth + "</adsize>"
                                      + "<adheight>" + objbookingDetail.AdsizeHeight + "</adheight>"
                                      + "<adwidth>" + objbookingDetail.AdsizeWidth + "</adwidth>"
                                      + "<adarea>" + Convert.ToDouble(objbookingDetail.AdsizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</adarea>"
                                      + "<billablesize>" + objbookingDetail.AdsizeHeight + "*" + objbookingDetail.AdsizeWidth + "</billablesize>"
                                      + "<billableheight>" + objbookingDetail.AdsizeHeight + "</billableheight>"
                                      + "<billablewidth>" + objbookingDetail.AdsizeWidth + "</billablewidth>"
                                      + "<billablearea>" + Convert.ToDouble(objbookingDetail.AdsizeHeight) * Convert.ToDouble(objbookingDetail.AdsizeWidth) + "</billablearea>";
                        }
                        strXml += "<itemratefieldchanged>" + objbookingDetail.list[i].ItemRateFieldChanged + "</itemratefieldchanged>"
                                  + "<agreedrate>" + objbookingDetail.list[i].AgreedRate + "</agreedrate>"
                                  + "<agreedamount>" + objbookingDetail.list[i].AgreedAmount + "</agreedamount>"
                                  + "<agreeddiscper>" + objbookingDetail.list[i].AgreedDiscPer + "</agreeddiscper>"
                                  + "<extrachargesper>" + objbookingDetail.list[i].ExtraChargesPer + "</extrachargesper>"
                                  + "<extrachargesamount>" + objbookingDetail.list[i].ExtraChargesAmount + "</extrachargesamount>"
                                  + "<extradiscountper>" + objbookingDetail.list[i].ExtraDiscPer + "</extradiscountper>"
                                  + "<extradiscountamount>" + objbookingDetail.list[i].ExtraDiscAmount + "</extradiscountamount>"
                                  + "<extraboxchargesper>" + objbookingDetail.ExtraBoxChargesPer + "</extraboxchargesper>"
                                  + "<extraboxchargesamount>" + objbookingDetail.ExtraBoxChargesAmount + "</extraboxchargesamount>"
                                  + "<readonlyflag>" + objbookingDetail.list[i].ReadOnlyFlag + "</readonlyflag>"
                                  + "<boxnumber>" + objbookingDetail.list[i].BoxNumber + "</boxnumber>"
                                  + "<startcol>" + objbookingDetail.list[i].StartCol + "</startcol>"
                                  + "<yposition>" + objbookingDetail.list[i].Yposition + "</yposition>"
                                  + "</itemlevel>";
                        strXml += "</insertlevel>";
                    }

                    if (objbookingDetail.PaymentTypeID == 1)
                    {
                        strXml += "<receiptetail>"
                                  + "<receiptamount>" + objbookingDetail.TotalReceivable + "</receiptamount>"
                                  + "<totalamountpaid>" + objbookingDetail.ReceiptAmount + "</totalamountpaid>"
                                  + "<writeoffamount>" + objbookingDetail.WriteoffAmount + "</writeoffamount>"
                                  + "<receiptdate>" + DateTime.Now.ToString("dd/MM/yyyy") + "</receiptdate>";
                        if (objbookingDetail.Amount != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        if (objbookingDetail.Amount1 != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID1 + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber1 + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount1 + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID1 + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName1 + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID1 + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName1 + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName1 + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        if (objbookingDetail.Amount2 != 0)
                        {
                            strXml += "<paymentdetail>"
                                      + "<paymentmodeid>" + objbookingDetail.PaymentModeID2 + "</paymentmodeid>"
                                      + "<chequenumber>" + objbookingDetail.ChequeNumber2 + "</chequenumber>"
                                      + "<chequedate></chequedate>"
                                      + "<amount>" + objbookingDetail.Amount2 + "</amount>"
                                      + "<bankid>" + objbookingDetail.BankID2 + "</bankid>"
                                      + "<bankname>" + objbookingDetail.BranchBankName2 + "</bankname>"
                                      + "<branchid>" + objbookingDetail.BankNameID2 + "</branchid>"
                                      + "<branchname>" + objbookingDetail.BranchName2 + "</branchname>"
                                      + "<bankbranchcode>" + objbookingDetail.BankName2 + "</bankbranchcode>"
                                      + "</paymentdetail>";
                        }
                        strXml += "</receiptetail>";
                    }
                    strXml += "</orderlevel></ebooking>";
                }

                DataTable         objdt = objHomeDAL.GeteBookingRateData(strXml).Tables[0];
                CSRateCalculation objRate;

                if (objdt.Rows.Count > 0)
                {
                    objRate         = new CSRateCalculation();
                    objRate.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    if (objRate.IsValid == 1 || objRate.IsValid == -2)
                    {
                        objRate.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                        objRate.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                        objListRate.Add(objRate);
                    }
                    else
                    {
                        foreach (DataRow dr in objdt.Rows)
                        {
                            objRate                        = new CSRateCalculation();
                            objRate.StartCol               = Convert.ToString(dr["StartCol"]);
                            objRate.Yposition              = Convert.ToString(dr["Yposition"]);
                            objRate.BoxNumber              = Convert.ToString(dr["BoxNumber"]);
                            objRate.RecID                  = Convert.ToInt16(dr["RecID"]);
                            objRate.BaseRate               = Convert.ToDouble(dr["BaseRate"]);
                            objRate.CardRate               = Convert.ToDouble(dr["CardRate"]);
                            objRate.CardAmount             = Convert.ToDouble(dr["CardAmount"]);
                            objRate.AgreedRate             = Convert.ToDouble(dr["AgreedRate"]);
                            objRate.AgreedAmount           = Convert.ToDouble(dr["AgreedAmount"]);
                            objRate.AgreedDiscPer          = Convert.ToDouble(dr["AgreedDiscPer"]);
                            objRate.AgreedDiscAmount       = Convert.ToDouble(dr["AgreedDiscAmount"]);
                            objRate.RateCardID             = Convert.ToInt16(dr["RateCardID"]);
                            objRate.AdRateID               = Convert.ToInt16(dr["AdRateID"]);
                            objRate.RateDiff               = Convert.ToDouble(dr["RateDiff"]);
                            objRate.BillableArea           = Convert.ToDouble(dr["BillableArea"]);
                            objRate.SizeID                 = Convert.ToInt16(dr["SizeID"]);
                            objRate.AdSizeWidth            = Convert.ToDouble(dr["SizeWidth"]);
                            objRate.AdSizeHeight           = Convert.ToDouble(dr["SizeHeight"]);
                            objRate.AdSizeArea             = Convert.ToDouble(dr["SizeArea"]);
                            objRate.ColWidth               = Convert.ToDouble(dr["ColWidth"]);
                            objRate.ColumnSize             = Convert.ToDouble(dr["ColumnSize"]);
                            objRate.Gutter                 = Convert.ToDouble(dr["Gutter"]);
                            objRate.AgencyCommissionPer    = Convert.ToDouble(dr["AgencyCommissionPer"]);
                            objRate.AgencyCommissionAmount = Convert.ToDouble(dr["AgencyCommissionAmount"]);
                            objRate.PreVATAmount           = Convert.ToDouble(dr["PreVATAmount"]);
                            objRate.Receivable             = Convert.ToDouble(dr["Receivable"]);
                            objRate.NetReceivable          = Convert.ToDouble(dr["NetReceivable"]);
                            objRate.ColorRate              = Convert.ToDouble(dr["ColorRate"]);
                            objRate.PremiaRate             = Convert.ToDouble(dr["PremiaRate"]);
                            objRate.VATPer                 = Convert.ToDouble(dr["VATPer"]);
                            objRate.VATAmount              = Convert.ToDouble(dr["VATAmount"]);
                            objRate.WtPer                  = Convert.ToDouble(dr["WtPer"]);
                            objRate.WTAmount               = Convert.ToDouble(dr["WTAmount"]);
                            objRate.ExtraDiscPer           = Convert.ToDouble(dr["ExtraDiscPer"]);
                            objRate.ExtraDiscAmount        = Convert.ToDouble(dr["ExtraDiscAmount"]);
                            objRate.ExtraChargesPer        = Convert.ToDouble(dr["ExtraChargesPer"]);
                            objRate.ExtraChargesAmount     = Convert.ToDouble(dr["ExtraChargesAmount"]);
                            objRate.ExtraBoxChargesPer     = Convert.ToDouble(dr["BoxChargesPer"]);
                            objRate.ExtraBoxChargesAmount  = Convert.ToDouble(dr["BoxChargesAmount"]);
                            objRate.ScheduledDate          = Convert.ToDateTime(dr["ScheduledDate"]).ToString("dd/MM/yyyy");
                            objRate.InsNum                 = Convert.ToInt16(dr["InsNum"]);
                            objRate.PackageID              = Convert.ToInt16(dr["PackageID"]);
                            objRate.PublicationID          = Convert.ToInt16(dr["PublicationID"]);
                            objRate.PEID                   = Convert.ToInt16(dr["PEID"]);
                            objRate.PremiaID               = Convert.ToInt16(dr["PremiaID"]);
                            objRate.ColorID                = Convert.ToInt16(dr["ColorID"]);
                            objRate.SchemeID               = Convert.ToInt16(dr["SchemeID"]);
                            objRate.SchemeDetailID         = Convert.ToInt16(dr["SchemeDetailID"]);
                            objRate.SchemeAmount           = Convert.ToDouble(dr["SchemeAmount"]);
                            objRate.SchemeName             = Convert.ToString(dr["SchemeName"]);
                            objRate.SchemeDays             = Convert.ToString(dr["SchemeDays"]);
                            objRate.AdTypeID               = Convert.ToInt16(dr["AdTypeID"]);
                            objRate.StyleSheetID           = Convert.ToInt16(dr["StyleSheetID"]);
                            objRate.StyleSheetName         = Convert.ToString(dr["StyleSheetName"]);
                            objRate.MinAmount              = Convert.ToDouble(dr["MinAmount"]);
                            objRate.MinArea                = Convert.ToDouble(dr["MinArea"]);
                            objRate.UOM                    = Convert.ToInt16(dr["UOM"]);
                            objRate.Status                 = Convert.ToInt16(dr["Status"]);
                            objRate.AuditStatus            = Convert.ToInt16(dr["AuditStatus"]);
                            objRate.MaterialType           = Convert.ToInt16(dr["MaterialType"]);
                            objRate.MaterialSource         = Convert.ToInt16(dr["MaterialSource"]);
                            objRate.ReceiptPayTypeID       = Convert.ToInt16(dr["ReceiptPayTypeID"]);
                            objRate.MBodyCount             = Convert.ToString(dr["MBodyCount"]);
                            objRate.RateFieldChanged       = Convert.ToInt16(dr["RateFieldChanged"]);
                            objRate.PECode                 = Convert.ToString(dr["PECode"]);
                            objRate.AdStatus               = Convert.ToString(dr["AdStatus"]);
                            objRate.AdClassification       = Convert.ToString(dr["AdClassification"]);
                            objRate.AdtypeID1              = Convert.ToInt16(dr["Adtype1"]);
                            objRate.AdtypeID2              = Convert.ToInt16(dr["Adtype2"]);
                            objRate.AdtypeID3              = Convert.ToInt16(dr["Adtype3"]);
                            objRate.AdtypeID4              = Convert.ToInt16(dr["Adtype4"]);
                            objRate.MaterialID             = Convert.ToString(dr["MaterialID"]);
                            objRate.ReadOnlyFlag           = Convert.ToString(dr["ReadOnlyFlag"]);
                            objRate.AdColumns              = Convert.ToString(dr["AdColumns"]);
                            objRate.ItemRateFieldChanged   = Convert.ToInt16(dr["ItemRateFieldChanged"]);
                            objRate.PackageIDSent          = Convert.ToInt16(dr["PackageIDSent"]);
                            objRate.U_BodyText             = Convert.ToString(dr["bodytext"]);
                            objRate.TotalWords             = Convert.ToString(dr["totalwords"]);
                            objRate.CharCount              = Convert.ToString(dr["charcount"]);
                            objListRate.Add(objRate);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayRateCalculationController::Post:", ex);
            }
            return(objListRate);
        }
Пример #15
0
        public Dictionary <string, object> Post(BookingDetail objbookingDetail)
        {
            Dictionary <string, object>  OrderDetails                 = new Dictionary <string, object>();
            List <OpenOrder>             objListOpenOrder             = new List <OpenOrder>();
            List <CompositeReceiptOrder> objListCompositeReceiptOrder = new List <CompositeReceiptOrder>();
            List <CompositeReceiptROID>  objListCompositeReceiptROID  = new List <CompositeReceiptROID>();
            OpenOrder objOpenOder;

            try
            {
                HomeDAL objHomeDAL = new HomeDAL();
                string  strXml     = string.Empty;
                strXml += "<ebooking><actionname>opencompositereceipt</actionname><receiptid>" + objbookingDetail.ReceiptID + "</receiptid></ebooking>";
                DataSet objds = objHomeDAL.eBookingActions(strXml);

                if (objds.Tables.Count == 1)
                {
                    objOpenOder         = new OpenOrder();
                    objOpenOder.IsValid = Convert.ToInt16(objds.Tables[0].Rows[0]["ErrorFlag"]);
                    if (objOpenOder.IsValid == 1)
                    {
                        objOpenOder.ErrorMessage = Convert.ToString(objds.Tables[0].Rows[0]["ErrorMessage"]);
                        objOpenOder.IsValid      = Convert.ToInt16(objds.Tables[0].Rows[0]["ErrorFlag"]);
                        objListOpenOrder.Add(objOpenOder);
                        OrderDetails.Add("OpenOrder", objListOpenOrder);
                    }
                }

                else
                {
                    DataTable             objdt  = objds.Tables[0];
                    DataTable             objdt1 = objds.Tables[1];
                    CompositeReceiptOrder objCompositeReceiptOder;

                    if (objdt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in objdt.Rows)
                        {
                            objCompositeReceiptOder                     = new CompositeReceiptOrder();
                            objCompositeReceiptOder.ReceiptID           = Convert.ToInt64(dr["ReceiptID"]);
                            objCompositeReceiptOder.TotalPayableAmount  = Convert.ToDouble(dr["TotalPayableAmount"]);
                            objCompositeReceiptOder.TotalAmountPaid     = Convert.ToDouble(dr["TotalAmountPaid"]);
                            objCompositeReceiptOder.WriteOffAmount      = Convert.ToDouble(dr["WriteOffAmount"]);
                            objCompositeReceiptOder.LogUserID           = Convert.ToInt64(dr["LogUserID"]);
                            objCompositeReceiptOder.ReceiptStatus       = Convert.ToInt16(dr["ReceiptStatus"]);
                            objCompositeReceiptOder.ReceiptRemarks      = Convert.ToString(dr["ReceiptRemarks"]);
                            objCompositeReceiptOder.CancelDate          = Convert.ToString(dr["CancelDate"]);
                            objCompositeReceiptOder.BillingRemarks      = Convert.ToString(dr["BillingRemarks"]);
                            objCompositeReceiptOder.CancellationRemarks = Convert.ToString(dr["CancellationRemarks"]);
                            objCompositeReceiptOder.ReceiptDate         = Convert.ToString(dr["ReceiptDate"]);
                            objCompositeReceiptOder.AdvancedUsed        = Convert.ToDouble(dr["AdvancedUsed"]);
                            objCompositeReceiptOder.AdvancedRecieved    = Convert.ToDouble(dr["AdvancedRecieved"]);
                            objCompositeReceiptOder.ReceiptCentreID     = Convert.ToInt16(dr["ReceiptCentreID"]);
                            objCompositeReceiptOder.ReceiptNumber       = Convert.ToInt64(dr["ReceiptNumber"]);
                            objCompositeReceiptOder.IsClassified        = Convert.ToInt16(dr["IsClassified"]);
                            objCompositeReceiptOder.CancelledUserId     = Convert.ToInt16(dr["CancelledUserId"]);
                            objCompositeReceiptOder.AgencyID            = Convert.ToInt16(dr["AgencyID"]);
                            objCompositeReceiptOder.ClientID            = Convert.ToInt16(dr["ClientID"]);
                            objCompositeReceiptOder.CasualClient        = Convert.ToString(dr["CasualClient"]);
                            objCompositeReceiptOder.AgencyName          = Convert.ToString(dr["AgencyName"]);
                            objCompositeReceiptOder.BillTo              = Convert.ToInt16(dr["BillTo"]);
                            objCompositeReceiptOder.RevenueCentreid     = Convert.ToInt16(dr["RevenueCentreid"]);
                            objCompositeReceiptOder.MachineName         = Convert.ToString(dr["MachineName"]);
                            objCompositeReceiptOder.CasualAddress       = Convert.ToString(dr["CasualAddress"]);
                            objCompositeReceiptOder.City                = Convert.ToString(dr["City"]);
                            objCompositeReceiptOder.Phone               = Convert.ToString(dr["Phone"]);
                            objCompositeReceiptOder.Zip                 = Convert.ToString(dr["Zip"]);
                            objCompositeReceiptOder.ReceiptPaymentMode  = Convert.ToInt16(dr["PaymentMode"]);
                            objCompositeReceiptOder.BankID              = Convert.ToInt16(dr["BankID"]);
                            objCompositeReceiptOder.CheckNumber         = Convert.ToString(dr["Number"]);
                            objCompositeReceiptOder.PaymentDate         = Convert.ToString(dr["PaymentDate"]);
                            objCompositeReceiptOder.Amount              = Convert.ToDouble(dr["Amount"]);
                            objCompositeReceiptOder.BankName            = Convert.ToString(dr["BankName"]);
                            objCompositeReceiptOder.BranchName          = Convert.ToString(dr["BranchName"]);
                            objCompositeReceiptOder.BranchID            = Convert.ToInt16(dr["BranchID"]);
                            objCompositeReceiptOder.BankBranchCode      = Convert.ToString(dr["BankBranchCode"]);
                            objCompositeReceiptOder.CashReceived        = Convert.ToDouble(dr["CashReceived"]);
                            objCompositeReceiptOder.CashRefund          = Convert.ToDouble(dr["CashRefund"]);
                            objCompositeReceiptOder.AdvanceReceiptID    = Convert.ToInt64(dr["AdvanceReceiptID"]);
                            objListCompositeReceiptOrder.Add(objCompositeReceiptOder);
                        }
                    }

                    CompositeReceiptROID objCompositeReceiptROID;
                    if (objdt1.Rows.Count > 0)
                    {
                        foreach (DataRow dr in objdt1.Rows)
                        {
                            objCompositeReceiptROID      = new CompositeReceiptROID();
                            objCompositeReceiptROID.ROID = Convert.ToString(dr["ROID"]);
                            objCompositeReceiptROID.Net  = Convert.ToDouble(dr["Net"]);
                            objListCompositeReceiptROID.Add(objCompositeReceiptROID);
                        }
                    }
                    OrderDetails.Add("CompoReceiptOrder", objListCompositeReceiptOrder);
                    OrderDetails.Add("CompoReceiptROID", objListCompositeReceiptROID);
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayOpenOrderController::Post:", ex);
            }
            return(OrderDetails);
        }
Пример #16
0
        //多少 加盟项目
        public List <HomeModel> HomeTheuser()
        {
            HomeDAL home = new HomeDAL();

            return(home.HomeTheuser());
        }
Пример #17
0
        public HomeModel HomeProjectreleased()
        {
            HomeDAL home = new HomeDAL();

            return(home.HomeProjectreleased());
        }
Пример #18
0
        public HomeJoininforModel HomeJoininfor()
        {
            HomeDAL home = new HomeDAL();

            return(home.HomeJoininfor());
        }
Пример #19
0
        public List <HomeModel> HomeThe_capital()
        {
            HomeDAL home = new HomeDAL();

            return(home.HomeThe_capital());
        }
        private void ModelErrors(Scheduling scheduling, bool isUpdate = false)
        {
            try
            {
                Employee employee = new EmployeeDAL().Get(scheduling.EmployeeId);
                Home     home     = new HomeDAL().Get(scheduling.HomeId);
                Service  service  = new ServiceDAL().Get(scheduling.ServiceId);

                if (scheduling.SchedulingTypeId.Equals(SchedulingType.TECHNICAL_ASSISTANCE) && scheduling.ServiceId == null)
                {
                    ModelState.AddModelError("scheduling.ServiceId", "Agendamentos do tipo '1 - ASSISTÊNCIA TÉCNICA' devem possuir um serviço.");
                }

                if (scheduling.SchedulingTypeId.Equals(SchedulingType.INSPECTION) && scheduling.ServiceId != null)
                {
                    ModelState.AddModelError("scheduling.ServiceId", "Agendamentos do tipo '2 - VISTORIA' não podem possuir serviço.");
                }

                if (scheduling.SchedulingTypeId == SchedulingType.TECHNICAL_ASSISTANCE && scheduling.SchedulingDate.Date > home.DeliveryDate.AddMonths(service.MonthsWarranty))
                {
                    ModelState.AddModelError("scheduling.ServiceId", "Esse serviço está fora da garantia para esse empreendimento.");
                }

                if (scheduling.SchedulingTypeId == SchedulingType.TECHNICAL_ASSISTANCE && employee.Role.RoleServices.All(rs => rs.ServiceId != service.Id))
                {
                    ModelState.AddModelError("scheduling.EmployeeId", "Esse funcionário não realiza esse serviço.");
                }

                if (scheduling.SchedulingTypeId == SchedulingType.INSPECTION && employee.Role.Id != Role.INSPECTION)
                {
                    ModelState.AddModelError("scheduling.EmployeeId", "Esse funcionário não realiza vistoria.");
                }

                if (employee.EmployeeDaysOff.Any(edo => edo.DayOffDate.Date == scheduling.SchedulingDate.Date))
                {
                    ModelState.AddModelError("scheduling.EmployeeId", "Esse funcionário não está disponível para essa data de agendamento.");
                }

                if (scheduling.SchedulingDate.Hour < employee.WorkStartsAt || scheduling.SchedulingDate.Hour >= employee.WorkEndsAt)
                {
                    ModelState.AddModelError("scheduling.EmployeeId", "Esse funcionário não está disponível para esse horário de agendamento.");
                }

                if (!isUpdate)
                {
                    int duration = (scheduling.SchedulingTypeId == SchedulingType.TECHNICAL_ASSISTANCE ? service.ServiceDuration : 4);
                    if (employee.Schedules.Any(s =>
                                               scheduling.SchedulingDate >= s.SchedulingDate &&
                                               scheduling.SchedulingDate <= s.SchedulingDate.AddHours(duration) &&
                                               s.SchedulingStatusId == SchedulingStatus.WAITING
                                               )
                        )
                    {
                        ModelState.AddModelError("scheduling.EmployeeId", "Esse funcionário não está disponível para essa data e/ou horário de agendamento.");
                    }
                }
            }
            catch (Exception)
            {
                ModelState.AddModelError("Message", "Erro interno.");
            }
        }
Пример #21
0
 public HomeController()
 {
     homeDao = new HomeDAL();
 }
Пример #22
0
        public List <HomeModel> HomeTojoinin()
        {
            HomeDAL home = new HomeDAL();

            return(home.HomeTojoinin());
        }
Пример #23
0
        public UserMasterPOCO CheckUserLogin(UserMasterPOCO aUser, ref string asReturnMessage)
        {
            HomeDAL homeDal = new HomeDAL();

            return(homeDal.CheckUserLogin(aUser, ref asReturnMessage));
        }
        public IEnumerable <DSRateCalculation> Post(BookingDetail objbookingDetail)
        {
            List <DSRateCalculation> objListRate = new List <DSRateCalculation>();

            try
            {
                HomeDAL  objHomeDAL              = new HomeDAL();
                string   strXml                  = string.Empty;
                string   dates                   = objbookingDetail.DateSelected;
                string[] selecteddate            = dates.Split(',');
                string   packages                = objbookingDetail.PackageID;
                string[] selectedpackages        = packages.Split(',');
                string   peids                   = objbookingDetail.PEID;
                string[] selectedpeids           = peids.Split(',');
                string   packageids              = string.Empty;
                string   statusids               = objbookingDetail.Status;
                string[] selectedstatusids       = statusids.Split(',');
                string   cauditstatusids         = objbookingDetail.AuditStatus;
                string[] selectedcauditstatusids = cauditstatusids.Split(',');
                if (selectedpackages.Length == 1)
                {
                    packageids = objbookingDetail.PackageID;
                }
                else
                {
                    packageids = "0";
                }

                if (selecteddate.Length > 0)
                {
                    strXml += "<ebooking>"
                              + "<orderlevel>"
                              + "<roid>" + objbookingDetail.ROID + "</roid>"
                              + "<bookingdate>" + objbookingDetail.BookingDate + "</bookingdate>" // + "<bookingdate>" + DateTime.Now.ToString("dd/MM/yyyy") + "</bookingdate>"
                              + "<revenuecentreid>" + objbookingDetail.RevenueCentreID + "</revenuecentreid>"
                              + "<bookingcentreid>" + objbookingDetail.BookingCentreID + "</bookingcentreid>"
                              + "<ratecentreid>" + objbookingDetail.RevenueCentreID + "</ratecentreid>"
                              + "<bookingexecid>" + objbookingDetail.UserId + "</bookingexecid>"
                              + "<ronumber>" + objbookingDetail.RONumber + "</ronumber>"
                              + "<agencyid>" + objbookingDetail.AgencyID + "</agencyid>"
                              + "<clientid>" + objbookingDetail.ClientID + "</clientid>"
                              + "<ccname>" + objbookingDetail.ClientName + "</ccname>"
                              + "<ccvatnumber>" + objbookingDetail.ClientVatNum + "</ccvatnumber>"
                              //+ "<adflag>1</adflag>"
                              //+ "<rateflag>0</rateflag>"
                              + "<packageid>" + packageids + "</packageid>"
                              + "<packagelist>" + objbookingDetail.PackageID + "</packagelist>"
                              + "<productid>" + objbookingDetail.ProductID + "</productid>"
                              + "<totalinsertions>" + selecteddate.Length + "</totalinsertions>"
                              + "<uom>" + objbookingDetail.UOMID + "</uom>"
                              + "<isclassified>" + objbookingDetail.IsClassified + "</isclassified>"
                              + "<ratefieldchanged>" + objbookingDetail.RateFieldChanged + "</ratefieldchanged>"
                              + "<boxtypeid>" + objbookingDetail.BoxTypeID + "</boxtypeid>"
                              + "<paymentmode>" + objbookingDetail.PaymentTypeID + "</paymentmode>"
                              + "<ismanualbilling>" + objbookingDetail.IsManualBilling + "</ismanualbilling>";


                    for (var i = 0; i < objbookingDetail.list.Count; i++)
                    {
                        // var date = selecteddate[i];
                        var date = objbookingDetail.list[i].ScheduledDate.Substring(0, 10);
                        strXml += "<insertlevel>"
                                  + "<insnum>" + objbookingDetail.list[i].InsNum + "</insnum>" //+ "<insnum>" + (i + 1) + "</insnum>"
                                  + "<invoicenum>0</invoicenum>";
                        //for (var j = 0; j < selectedpeids.Length; j++)
                        //{
                        var peid = objbookingDetail.list[i].PEID;    //selectedpeids[j];
                        strXml += "<itemlevel>"
                                  + "<peid>" + peid + "</peid>"
                                  + "<adtypeid>" + objbookingDetail.AdtypeId + "</adtypeid>"
                                  + "<releaseid>0</releaseid>"
                                  + "<scheduleddate>" + date + "</scheduleddate>"
                                  + "<status>" + objbookingDetail.list[i].Status + "</status>"
                                  + "<auditstatus>" + objbookingDetail.list[i].AuditStatus + "</auditstatus>"
                                  + "<paymentstatus>0</paymentstatus>"
                                  + "<materialstatus>0</materialstatus>"
                                  + "<adsize>" + objbookingDetail.list[i].AdSizeHeight + "*" + objbookingDetail.list[i].AdSizeWidth + "</adsize>"
                                  + "<adsizeid>" + objbookingDetail.list[i].AdsizeID + "</adsizeid>"
                                  + "<adheight>" + objbookingDetail.list[i].AdSizeHeight + "</adheight>"
                                  + "<adwidth>" + objbookingDetail.list[i].AdSizeWidth + "</adwidth>"
                                  + "<adarea>" + Convert.ToDouble(objbookingDetail.list[i].AdSizeHeight) * Convert.ToDouble(objbookingDetail.list[i].AdSizeWidth) + "</adarea>"
                                  + "<billablesize>" + objbookingDetail.list[i].BillableSize + "</billablesize>"
                                  + "<billableheight>" + objbookingDetail.list[i].BillableSize.Split('*')[0] + "</billableheight>"
                                  + "<billablewidth>" + objbookingDetail.list[i].BillableSize.Split('*')[1] + "</billablewidth>"
                                  + "<billablearea>" + Convert.ToDouble(objbookingDetail.list[i].BillableSize.Split('*')[0]) * Convert.ToDouble(objbookingDetail.list[i].BillableSize.Split('*')[1]) + "</billablearea>"
                                  //+ "<billablesize>" + objbookingDetail.list[i].BillableSize + "</billablesize>"
                                  //+ "<billableheight>" + objbookingDetail.list[i].Billableheight + "</billableheight>"
                                  //+ "<billablewidth>" + objbookingDetail.list[i].Billablewidth + "</billablewidth>"
                                  //+ "<billablearea>" + Convert.ToDouble(objbookingDetail.list[i].Billableheight) * Convert.ToDouble(objbookingDetail.list[i].Billablewidth) + "</billablearea>"
                                  + "<premiaid>" + objbookingDetail.list[i].PremiaID + "</premiaid>"
                                  + "<colorid>" + objbookingDetail.list[i].ColorID + "</colorid>"
                                  + "<itemratefieldchanged>" + objbookingDetail.list[i].ItemRateFieldChanged + "</itemratefieldchanged>"
                                  + "<agreedrate>" + objbookingDetail.list[i].AgreedRate + "</agreedrate>"
                                  + "<agreedamount>" + objbookingDetail.list[i].AgreedAmount + "</agreedamount>"
                                  + "<agreeddiscper>" + objbookingDetail.list[i].AgreedDiscPer + "</agreeddiscper>"
                                  + "<extrachargesper>" + objbookingDetail.list[i].ExtraChargesPer + "</extrachargesper>"
                                  + "<extrachargesamount>" + objbookingDetail.list[i].ExtraChargesAmount + "</extrachargesamount>"
                                  + "<extradiscountper>" + objbookingDetail.list[i].ExtraDiscPer + "</extradiscountper>"
                                  + "<extradiscountamount>" + objbookingDetail.list[i].ExtraDiscAmount + "</extradiscountamount>"
                                  + "<extraboxchargesper>" + objbookingDetail.ExtraBoxChargesPer + "</extraboxchargesper>"
                                  + "<extraboxchargesamount>" + objbookingDetail.ExtraBoxChargesAmount + "</extraboxchargesamount>"
                                  + "<materialtype>" + objbookingDetail.list[i].MaterialType + "</materialtype>"
                                  + "<materialid>" + objbookingDetail.list[i].MaterialID + "</materialid>"
                                  + "<readonlyflag>" + objbookingDetail.list[i].ReadOnlyFlag + "</readonlyflag>"
                                  + "<boxnumber>" + objbookingDetail.list[i].BoxNumber + "</boxnumber>"
                                  + "<startcol>" + objbookingDetail.list[i].StartCol + "</startcol>"
                                  + "<yposition>" + objbookingDetail.list[i].Yposition + "</yposition>"
                                  + "</itemlevel>";
                        //  }
                        strXml += "</insertlevel>";
                    }
                    strXml += "</orderlevel></ebooking>";
                }

                DataTable         objdt = objHomeDAL.GeteBookingRateData(strXml).Tables[0];
                DSRateCalculation objRate;

                if (objdt.Rows.Count > 0)
                {
                    objRate         = new DSRateCalculation();
                    objRate.IsValid = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                    if (objRate.IsValid == 1 || objRate.IsValid == -2)
                    {
                        objRate.ErrorMessage = Convert.ToString(objdt.Rows[0]["ErrorMessage"]);
                        objRate.IsValid      = Convert.ToInt16(objdt.Rows[0]["ErrorFlag"]);
                        objListRate.Add(objRate);
                    }
                    else
                    {
                        foreach (DataRow dr in objdt.Rows)
                        {
                            objRate                         = new DSRateCalculation();
                            objRate.StartCol                = Convert.ToString(dr["StartCol"]);
                            objRate.Yposition               = Convert.ToString(dr["Yposition"]);
                            objRate.BoxNumber               = Convert.ToString(dr["BoxNumber"]);
                            objRate.RecID                   = Convert.ToInt16(dr["RecID"]);
                            objRate.BaseRate                = Convert.ToDouble(dr["BaseRate"]);
                            objRate.CardRate                = Convert.ToDouble(dr["CardRate"]);
                            objRate.CardAmount              = Convert.ToDouble(dr["CardAmount"]);
                            objRate.AgreedRate              = Convert.ToDouble(dr["AgreedRate"]);
                            objRate.AgreedAmount            = Convert.ToDouble(dr["AgreedAmount"]);
                            objRate.AgreedDiscPer           = Convert.ToDecimal(dr["AgreedDiscPer"]);
                            objRate.AgreedDiscAmount        = Convert.ToDouble(dr["AgreedDiscAmount"]);
                            objRate.RateCardID              = Convert.ToInt16(dr["RateCardID"]);
                            objRate.AdRateID                = Convert.ToInt16(dr["AdRateID"]);
                            objRate.RateDiff                = Convert.ToDouble(dr["RateDiff"]);
                            objRate.BillableArea            = Convert.ToDouble(dr["BillableArea"]);
                            objRate.AdsizeID                = Convert.ToInt16(dr["SizeID"]);
                            objRate.AdSizeWidth             = Convert.ToDouble(dr["SizeWidth"]);
                            objRate.AdSizeHeight            = Convert.ToDouble(dr["SizeHeight"]);
                            objRate.AdSizeArea              = Convert.ToDouble(dr["SizeArea"]);
                            objRate.ColWidth                = Convert.ToDouble(dr["ColWidth"]);
                            objRate.ColumnSize              = Convert.ToDouble(dr["ColumnSize"]);
                            objRate.Gutter                  = Convert.ToDouble(dr["Gutter"]);
                            objRate.AgencyCommissionPer     = Convert.ToDouble(dr["AgencyCommissionPer"]);
                            objRate.AgencyCommissionAmount  = Convert.ToDouble(dr["AgencyCommissionAmount"]);
                            objRate.PreVATAmount            = Convert.ToDouble(dr["PreVATAmount"]);
                            objRate.Receivable              = Convert.ToDouble(dr["Receivable"]);
                            objRate.NetReceivable           = Convert.ToDouble(dr["NetReceivable"]);
                            objRate.ColorRate               = Convert.ToDouble(dr["ColorRate"]);
                            objRate.PremiaRate              = Convert.ToDouble(dr["PremiaRate"]);
                            objRate.VATPer                  = Convert.ToDouble(dr["VATPer"]);
                            objRate.VATAmount               = Convert.ToDouble(dr["VATAmount"]);
                            objRate.WtPer                   = Convert.ToDouble(dr["WtPer"]);
                            objRate.WTAmount                = Convert.ToDouble(dr["WTAmount"]);
                            objRate.ExtraDiscPer            = Convert.ToDouble(dr["ExtraDiscPer"]);
                            objRate.ExtraDiscAmount         = Convert.ToDouble(dr["ExtraDiscAmount"]);
                            objRate.ExtraChargesPer         = Convert.ToDouble(dr["ExtraChargesPer"]);
                            objRate.ExtraChargesAmount      = Convert.ToDouble(dr["ExtraChargesAmount"]);
                            objRate.ExtraBoxChargesPer      = Convert.ToDouble(dr["BoxChargesPer"]);
                            objRate.ExtraBoxChargesAmount   = Convert.ToDouble(dr["BoxChargesAmount"]);
                            objRate.ScheduledDate           = Convert.ToDateTime(dr["ScheduledDate"]).ToString("dd/MM/yyyy");
                            objRate.InsNum                  = Convert.ToInt16(dr["InsNum"]);
                            objRate.PackageID               = Convert.ToInt16(dr["PackageID"]);
                            objRate.PublicationID           = Convert.ToInt16(dr["PublicationID"]);
                            objRate.PEID                    = Convert.ToInt16(dr["PEID"]);
                            objRate.PremiaID                = Convert.ToInt16(dr["PremiaID"]);
                            objRate.ColorID                 = Convert.ToInt16(dr["ColorID"]);
                            objRate.SchemeID                = Convert.ToInt16(dr["SchemeID"]);
                            objRate.SchemeDetailID          = Convert.ToInt16(dr["SchemeDetailID"]);
                            objRate.SchemeAmount            = Convert.ToDouble(dr["SchemeAmount"]);
                            objRate.SchemeName              = Convert.ToString(dr["SchemeName"]);
                            objRate.SchemeDays              = Convert.ToString(dr["SchemeDays"]);
                            objRate.AdTypeID                = Convert.ToInt16(dr["AdTypeID"]);
                            objRate.UOM                     = Convert.ToInt16(dr["UOM"]);
                            objRate.Status                  = Convert.ToInt16(dr["Status"]);
                            objRate.AuditStatus             = Convert.ToInt16(dr["AuditStatus"]);
                            objRate.MaterialType            = Convert.ToInt16(dr["MaterialType"]);
                            objRate.MaterialSource          = Convert.ToInt16(dr["MaterialSource"]);
                            objRate.ReceiptPayTypeID        = Convert.ToInt16(dr["ReceiptPayTypeID"]);
                            objRate.PECode                  = Convert.ToString(dr["PECode"]);
                            objRate.AdStatus                = Convert.ToString(dr["AdStatus"]);
                            objRate.PremiaName              = Convert.ToString(dr["PremiaName"]);
                            objRate.SizeName                = Convert.ToString(dr["SizeName"]);
                            objRate.ColorName               = Convert.ToString(dr["ColorName"]);
                            objRate.BillableSize            = Convert.ToString(dr["BillableSize"]);
                            objRate.MaterialID              = Convert.ToString(dr["MaterialID"]);
                            objRate.ReadOnlyFlag            = Convert.ToString(dr["ReadOnlyFlag"]);
                            objRate.MaterialTypeDescription = Convert.ToString(dr["MaterialTypeDescription"]);
                            objRate.ItemRateFieldChanged    = Convert.ToInt16(dr["ItemRateFieldChanged"]);
                            objRate.PackageIDSent           = Convert.ToInt16(dr["PackageIDSent"]);
                            objListRate.Add(objRate);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ReportError("DisplayRateCalculationController::Post:", ex);
            }
            return(objListRate);
        }