Example #1
0
        private void Update_Submit(DateTime vFromDate, DateTime vToDate, DateTime vSetDate)
        {
            try
            {
                var userEntity          = (UserEntity)Session["ID"];
                ProjectDenominators dc2 = new ProjectDenominators();
                string projectname      = ddlPROJECT.SelectedValue.ToString();
                string multiplydate     = GeneralUtility.ConvertSystemDateStringFormat(txtDcDate.Text.Trim()).Substring(0, 6);
                //decimal multiply = Convert.ToDecimal(txtDcTimes.Text);

                DBReader <DenoChangeEntity> dr = new DBReader <DenoChangeEntity>();
                string DcID = dr.ExcuteScalar("Select ID From DenoChange Where Project = '" + projectname + "' And DCDate = '" + GeneralUtility.ConvertSystemDateStringFormat(vSetDate) + "'", null, ConnectionDAO.Client.ToConnectionString()).ToString();

                string DChangeDate = GeneralUtility.ConvertSystemDateStringFormat(txtDcDate.Text.Trim());
                System.Nullable <Decimal> probesvalue;
                System.Nullable <Decimal> pricingprobesvalue;
                System.Nullable <Decimal> votesvalue;
                System.Nullable <Decimal> masksvalue;
                System.Nullable <Decimal> repricingvalue;
                System.Nullable <Decimal> scenerecogvalue;
                System.Nullable <Decimal> probesperscenevalue;
                System.Nullable <Decimal> expertvalue;
                System.Nullable <Decimal> expertvotingvalue;
                if (txtProbes.Text != "" && txtProbes.Text != "0")
                {
                    probesvalue = Convert.ToDecimal(txtProbes.Text);
                }

                else
                {
                    probesvalue = null;
                }

                if (txtPricingProbes.Text != "" && txtPricingProbes.Text != "0")
                {
                    pricingprobesvalue = Convert.ToDecimal(txtPricingProbes.Text);
                }

                else
                {
                    pricingprobesvalue = null;
                }

                if (txtVotes.Text != "" && txtVotes.Text != "0")
                {
                    votesvalue = Convert.ToDecimal(txtVotes.Text);
                }

                else
                {
                    votesvalue = null;
                }

                if (txtMasks.Text != "" && txtMasks.Text != "0")
                {
                    masksvalue = Convert.ToDecimal(txtMasks.Text);
                }

                else
                {
                    masksvalue = null;
                }


                if (txtRepricing.Text != "" && txtRepricing.Text != "0")
                {
                    repricingvalue = Convert.ToDecimal(txtRepricing.Text);
                }

                else
                {
                    repricingvalue = null;
                }

                if (txtSceneRecog.Text != "" && txtSceneRecog.Text != "0")
                {
                    scenerecogvalue = Convert.ToDecimal(txtSceneRecog.Text);
                }

                else
                {
                    scenerecogvalue = null;
                }

                if (txtScenes.Text != "" && txtScenes.Text != "0")
                {
                    probesperscenevalue = Convert.ToDecimal(txtScenes.Text);
                }

                else
                {
                    probesperscenevalue = null;
                }

                if (txtCategoryExpert.Text != "" && txtCategoryExpert.Text != "0")
                {
                    expertvalue = Convert.ToDecimal(txtCategoryExpert.Text);
                }

                else
                {
                    expertvalue = null;
                }

                if (txtExpertVoting.Text != "" && txtExpertVoting.Text != "0")
                {
                    expertvotingvalue = Convert.ToDecimal(txtExpertVoting.Text);
                }

                else
                {
                    expertvotingvalue = null;
                }

                while (vSetDate <= vToDate)
                {
                    new DenoChange
                    {
                        Entity = new DenoChangeEntity
                        {
                            ID             = DcID,
                            PROJECT        = projectname,
                            DCDate         = GeneralUtility.ConvertSystemDateStringFormat(vSetDate),
                            Probes         = probesvalue,
                            Pricingprobes  = pricingprobesvalue,
                            Votes          = votesvalue,
                            Masks          = masksvalue,
                            Repricing      = repricingvalue,
                            SceneRecog     = scenerecogvalue,
                            ProbesperScene = probesperscenevalue,
                            Expert         = expertvalue,
                            ExpertVoting   = expertvotingvalue,
                            //Probes = Convert.ToDecimal(string.IsNullOrEmpty(txtProbes.Text) ? "0" : txtProbes.Text),
                            //Pricingprobes = Convert.ToDecimal(string.IsNullOrEmpty(txtPricingProbes.Text) ? "0" : txtPricingProbes.Text),
                            //Votes = Convert.ToDecimal(string.IsNullOrEmpty(txtVotes.Text) ? "0" : txtVotes.Text),
                            //Masks = Convert.ToDecimal(string.IsNullOrEmpty(txtMasks.Text) ? "0" : txtMasks.Text),
                            //Repricing = Convert.ToDecimal(string.IsNullOrEmpty(txtRepricing.Text) ? "0" : txtRepricing.Text),
                            //SceneRecog = Convert.ToDecimal(string.IsNullOrEmpty(txtSceneRecog.Text) ? "0" : txtSceneRecog.Text),
                            //ProbesperScene = Convert.ToDecimal(string.IsNullOrEmpty(txtScenes.Text) ? "0" : txtScenes.Text),
                            //Expert = Convert.ToDecimal(string.IsNullOrEmpty(txtCategoryExpert.Text) ? "0" : txtCategoryExpert.Text),
                            Createdby   = userEntity.ID,
                            UpdatedBy   = userEntity.ID,
                            UpdatedDate = GeneralUtility.ConvertSystemDateStringFormat(System.DateTime.Now),
                        }
                    }.Update();
                    vSetDate = vSetDate.AddDays(1);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
 public object ExcuteScalar(string aSQL, List <System.Data.Common.DbParameter> aPrams, string con)
 {
     return(DBReader.ExcuteScalar(aSQL, aPrams, con));
 }