Esempio n. 1
0
        private void UpdatePricingStatus(int _PricingTradeID, int _currentStatus)
        {
            TradePricing obj = new TradePricing();
            obj.LoadByPrimaryKey(_PricingTradeID);

            switch (_currentStatus)
            {
                case 1:
                    // in case of we are in initial status
                    obj.PricingStatusID = 2;
                    obj.Save();
                    break;
                case 2:
                // in case of we are in Appointed Informed
                    obj.PricingStatusID = 3;
                    obj.Save();
                    break;
                case 3:
                    // in case of we are in Price Informed
                    obj.PricingStatusID = 4;
                    obj.Save();
                    break;
            }
        }
Esempio n. 2
0
        protected void ui_LB_Assign_Click(object sender, EventArgs e)
        {
            LinkButton lnBtn = (LinkButton)sender;
            TradePricing objData = new TradePricing();
            objData.LoadByPrimaryKey(Int32.Parse(lnBtn.CommandArgument));

            foreach (GridViewRow row in ui_gvSearchResults.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    LinkButton lnBtn2 = (LinkButton)row.FindControl("ui_LB_Assign");
                    if (lnBtn.CommandArgument == lnBtn2.CommandArgument)
                    {
                        objData.AssignedUserID = int.Parse(((DropDownList)row.FindControl("ui_ddlAssignedTo")).SelectedValue);
                        objData.Save();
                        ui_lblDone.Text = "Assignation Done";
                    }
                }
            }
            SearchCases();
        }
        /// <summary>
        /// Saving new pricing request
        /// </summary>
        private void SavePricingRequest()
        {
            try
            {
                TradePricing objPricing = new TradePricing();

                objPricing.AddNew();

                objPricing.CompanyID = Int32.Parse(ui_drpCompanies.SelectedValue);
                objPricing.ManufactureID = Int32.Parse(ui_drpManufactures.SelectedValue);
                objPricing.TradeName = ui_txtTradeName.Text;
                objPricing.SubmissionDate = ui_txtSubmissionDate.Text;
                objPricing.CompanyPrice = float.Parse(ui_txtPrice.Text);
                objPricing.DosageFormID = Int32.Parse(ui_drpDosageForm.SelectedValue);
                objPricing.RegistrationCommitteTypeID = Int32.Parse(ui_drpCommitteType.SelectedValue);
                objPricing.Pack = ui_txtPack.Text;
                objPricing.FileNo = ui_txtFileNo.Text;
                objPricing.FileTypeID = Int32.Parse(ui_drpFileType.SelectedValue);
                objPricing.PricingStatusID = 1;
                objPricing.DiscussionDate = DateTime.Now.ToString(); // Update the status changes date .
                objPricing.ImportedManufacture = ui_txtImportedManufacture.Text;
                //TODO: Save File to disk and save it's path.
                objPricing.FilePath = "";

                objPricing.Save();

                // Save File.
                string savedFileName = SaveFile(objPricing.TradePricingID);
                objPricing.FilePath = savedFileName;
                objPricing.Save();

                ShowUploadedFile(savedFileName, objPricing.TradePricingID);

                ui_lblResult.ForeColor = System.Drawing.Color.Green;
                ui_lblResult.Text = "The new record saved successfully";

                // Insert Inistial Status record for the new rquest ( status = initiated )
                //-----------------------------------------------------------------------
                StatusHistory objStatus = new StatusHistory();
                objStatus.AddNew();
                objStatus.PricingStatusID = 1; // Will be initiated by default.
                objStatus.StatusDate = DateTime.Now;
                objStatus.TradePricingID = objPricing.TradePricingID;
                objStatus.CurrentPrice = objPricing.CompanyPrice;
                objStatus.Save();
                //--------------------------------------------------------------

                //Response.Redirect("New_Request.aspx?ID=" + objPricing.TradePricingID + "&type=new#tab_1_2");

                TradePriceID = objPricing.TradePricingID;
                InitializeUpdateMode();

            }
            catch
            {
                ui_lblResult.ForeColor = System.Drawing.Color.Red;
                ui_lblResult.Text = "Problem while saving the new record";
            }
        }
        /// <summary>
        /// Update pricing request
        /// </summary>
        private void UpdatePricingRequest()
        {
            try
            {
                TradePricing objPricing = new TradePricing();

                objPricing.LoadByPrimaryKey(TradePriceID);

                objPricing.CompanyID = Int32.Parse(ui_drpCompanies.SelectedValue);
                objPricing.ManufactureID = Int32.Parse(ui_drpManufactures.SelectedValue);
                objPricing.TradeName = ui_txtTradeName.Text;
                objPricing.SubmissionDate = ui_txtSubmissionDate.Text;
                objPricing.CompanyPrice = float.Parse(ui_txtPrice.Text);
                objPricing.DosageFormID = Int32.Parse(ui_drpDosageForm.SelectedValue);
                objPricing.RegistrationCommitteTypeID = Int32.Parse(ui_drpCommitteType.SelectedValue);
                objPricing.Pack = ui_txtPack.Text;
                objPricing.FileNo = ui_txtFileNo.Text;
                objPricing.FileTypeID = Int32.Parse(ui_drpFileType.SelectedValue);
             //   objPricing.PricingStatusID = 1;
                objPricing.ImportedManufacture = ui_txtImportedManufacture.Text;
                //TODO: Save File to disk and save it's path.

                objPricing.Save();

                // Save File.
                string savedFileName = SaveFile(objPricing.TradePricingID);
                objPricing.FilePath = savedFileName;
                objPricing.Save();

                ShowUploadedFile(savedFileName, objPricing.TradePricingID);

                ui_lblResult.ForeColor = System.Drawing.Color.Green;
                ui_lblResult.Text = "The record updated successfully";

            }
            catch
            {
                ui_lblResult.ForeColor = System.Drawing.Color.Red;
                ui_lblResult.Text = "Problem while saving the record";
            }
        }
        private void AddNewStatusHistory()
        {
            StatusHistory objStatus = new StatusHistory();
            objStatus.AddNew();

            objStatus.PricingStatusID = int.Parse(ui_drpTradeStatus.SelectedValue);
            objStatus.StatusDate = DateTime.Now;
            objStatus.Comment = ui_txtStatusComment.Text;
            objStatus.TradePricingID = TradePriceID;
            objStatus.AttachementPath = "";
            objStatus.Save();

            // if file exist - save it with the current record
            if (ui_fileStatusUpload.HasFile)
            {
                objStatus.AttachementPath = SaveStatusFile(objStatus.StatusHistoryID);
                objStatus.Save();
            }

            // Upate the Trade Pricing Record with the last status we have .
            TradePricing objTradePricing = new TradePricing();
            objTradePricing.LoadByPrimaryKey(TradePriceID);
            objTradePricing.PricingStatusID = objStatus.PricingStatusID;
            objTradePricing.DiscussionDate = DateTime.Now.ToString(); // Record status change date.
            objTradePricing.Save();
        }
        /// <summary>
        /// Saving new pricing request
        /// </summary>
        private void SavePricingRequest()
        {
            try
            {
                TradePricing objPricing = new TradePricing();

                objPricing.AddNew();

                objPricing.CompanyID = Int32.Parse(ui_drpCompanies.SelectedValue);
                objPricing.ManufactureID = Int32.Parse(ui_drpManufactures.SelectedValue);
                objPricing.TradeName = ui_txtTradeName.Text;
                objPricing.SubmissionDate = ui_txtSubmissionDate.Text;
                objPricing.CompanyPrice = float.Parse(ui_txtPrice.Text);
                objPricing.DosageFormID = Int32.Parse(ui_drpDosageForm.SelectedValue);
                objPricing.RegistrationCommitteTypeID = Int32.Parse(ui_drpCommitteType.SelectedValue);
                objPricing.Pack = ui_txtPack.Text;
                objPricing.FileNo = ui_txtFileNo.Text;
                objPricing.FileTypeID = Int32.Parse(ui_drpFileType.SelectedValue);
                objPricing.PricingStatusID = 1;
                objPricing.DiscussionDate = DateTime.Now.ToString(); // Save the date of status changing.
                objPricing.ImportedManufacture = ui_txtImportedManufacture.Text;
                //TODO: Save File to disk and save it's path.
                objPricing.FilePath = "";

                objPricing.Save();

                // Save File.
                string savedFileName = SaveFile(objPricing.TradePricingID);
                objPricing.FilePath = savedFileName;
                objPricing.Save();

                ShowUploadedFile(savedFileName, objPricing.TradePricingID);

                ui_lblResult.ForeColor = System.Drawing.Color.Green;
                ui_lblResult.Text = "The new record saved successfully";

                Response.Redirect("TradeSearch.aspx?ID=" + objPricing.TradePricingID + "&type=new");

            }
            catch
            {
                ui_lblResult.ForeColor = System.Drawing.Color.Red;
                ui_lblResult.Text = "Problem while saving the new record";
            }
        }
        private void SaveBeforeCommitte()
        {
            try
            {
                TradePricing objPricing = new TradePricing();
                objPricing.LoadByPrimaryKey(TradePriceID);
                // before commitee
                if(uiDropDownListCommitterType_Before.SelectedValue != "-1")
                    objPricing.RegistrationCommitteTypeID = Convert.ToInt32(uiDropDownListCommitterType_Before.SelectedValue);
                if (uiDropDownListStatusType.SelectedValue != "-1")
                    objPricing.TradePricingStatusID = Convert.ToInt32(uiDropDownListStatusType.SelectedValue);
                if (uiDropDownListLicenseType.SelectedValue != "-1")
                    objPricing.TradePricingLicenseTypeID = Convert.ToInt32(uiDropDownListLicenseType.SelectedValue);
                objPricing.RegNo = uiTextBoxBeforeRegNo.Text;
                objPricing.Reference = uiTextBoxReference.Text;
                objPricing.Indication = uiTextBoxIndication.Text;
                objPricing.Dose = uiTextBoxDose.Text;
                objPricing.SubmittedToSpecialized = uiCheckBoxSubmittedToSpecialized.Checked;
                objPricing.SalesTaxes = uiCheckBoxSalesTaxes.Checked;
                objPricing.EssentialDrugList = uiCheckBoxEssentialDrugList.Checked;

                objPricing.Save();

            }
            catch
            {

            }
        }
 private void SaveAfterCommitte()
 {
     try
     {
         TradePricing objPricing = new TradePricing();
         objPricing.LoadByPrimaryKey(TradePriceID);
         // after commite
         if (uiDropDownListSectorType.SelectedValue != "-1")
             objPricing.SectorTypeID = Convert.ToInt32(uiDropDownListSectorType.SelectedValue);
         objPricing.RegNo = uiTextBoxRegNoAfter.Text;
         objPricing.CommitteePrice = uiTextBoxCommittePrice.Text;
         DateTime date;
         if (DateTime.TryParseExact(uiTextBoxCommitteDate.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out date))
             objPricing.CommiteeDate = date;
         objPricing.CommitteePrice = uiTextBoxCommittePrice.Text;
         objPricing.RationalForPricing = uiTextBoxRationalForPricing.Text;
         if (!string.IsNullOrEmpty(uiTextBoxNoInBox.Text))
         {
             int x = 0;
             int.TryParse(uiTextBoxNoInBox.Text, out x);
             objPricing.NoInBox = x;
         }
         objPricing.LowestIntPrice = uiTextBoxLowestIntPriceBrand.Text;
         objPricing.PriceInEgy = uiTextBoxBrandPriceInEgy.Text;
         objPricing.PriceAfter30 = uiTextBoxPriceAfter30.Text;
         objPricing.PriceAfter35HighTech = uiTextBoxPriceAfter35.Text;
         objPricing.PriceAfter35FirstGeneric = uiTextBoxPriceAfter35FirstGeneric.Text;
         objPricing.PriceAfter40SecondGeneric = uiTextBoxPriceAfter40ndGeneric.Text;
         objPricing.LowestPriceGeneric = uiTextBoxLowestPriceGeneric.Text;
         objPricing.FinalPrice = uiTextBoxFinalPrice.Text;
         objPricing.IsPricedTo499 = uiCheckBoxIsPricedTo499.Checked;
         objPricing.Notes = uiTextBoxNotes.Text;
         objPricing.MainGroup = uiTextBoxMainGroup.Text;
         objPricing.MonthYear = uiTextBoxMonth.Text;
         objPricing.Similar = uiCheckBoxSimilar.Checked;
         objPricing.PreviousPack = uiTextBoxPreviouspack.Text;
         objPricing.PreviousPrice = uiTextBoxPreviousPrice.Text;
         objPricing.Save();
     }
     catch (Exception ex)
     {
     }
 }
        private void AddNewStatusHistory()
        {
            // condition added to solve refresh postback action
            if (Session["RefreshHit_Capa_ts"].ToString() == ViewState["RefreshHit_Capa_ts"].ToString())
            {
                StatusHistory objStatus = new StatusHistory();
                objStatus.AddNew();

                objStatus.PricingStatusID = int.Parse(ui_drpTradeStatus.SelectedValue);
                objStatus.StatusDate = DateTime.Now;
                objStatus.Comment = ui_txtStatusComment.Text;
                objStatus.TradePricingID = TradePriceID;
                objStatus.AttachementPath = "";

                if (ui_drpTradeStatus.SelectedValue == "5")
                {
                    objStatus.CommitteeTypeID = int.Parse(ui_drpCommitteeTypes.SelectedValue);
                    DateTime comDate = DateTime.Parse(ui_txtCommitteeDate.Text + " " + drpCommitteeHours.SelectedItem.Text + ":" + drpCommitteeMinutes.SelectedItem.Text + ":00");
                    objStatus.CommitteDate = comDate;
                }
                objStatus.Save();

                // if file exist - save it with the current record
                if (ui_fileStatusUpload.HasFile)
                {
                    objStatus.AttachementPath = SaveStatusFile(objStatus.StatusHistoryID);
                    objStatus.Save();
                }

                // Upate the Trade Pricing Record with the last status we have .
                TradePricing objTradePricing = new TradePricing();
                objTradePricing.LoadByPrimaryKey(TradePriceID);
                objTradePricing.PricingStatusID = objStatus.PricingStatusID;
                objTradePricing.DiscussionDate = DateTime.Now.ToString();
                objTradePricing.Save();

                //solve refresh postback action
                Session["RefreshHit_Capa_ts"] = Server.UrlEncode(System.DateTime.Now.ToString());
            }
        }