Example #1
0
        private void LoadGradingFactors(Guid Commodity, Guid CommodityGradeId)
        {
            List <GradingFactorBLL> list = new List <GradingFactorBLL>();
            GradingFactorBLL        obj  = new GradingFactorBLL();


            if (Commodity != Guid.Empty)
            {
                if (this.chkRecivedGrade.Checked == false || Commodity.ToString().ToUpper().Trim() != ConfigurationSettings.AppSettings["CoffeeId"].ToUpper().Trim())
                {
                    list = obj.GetGradingFactors(Commodity);
                }
                else
                {
                    if (Commodity.ToString().ToUpper().Trim() == ConfigurationSettings.AppSettings["CoffeeId"].ToUpper().Trim())
                    {
                        list = new List <GradingFactorBLL>();
                    }
                }
            }
            if (Commodity.ToString().ToUpper().Trim() == ConfigurationSettings.AppSettings["CoffeeId"].ToUpper().Trim())
            {
                if (CommodityGradeId != Guid.Empty)
                {
                    List <GradingFactorBLL> objList = null;
                    objList = obj.GetGradingFactors(CommodityGradeId);
                    if (objList != null)
                    {
                        if (list == null)
                        {
                            list = new List <GradingFactorBLL>();
                        }
                        foreach (GradingFactorBLL o in objList)
                        {
                            list.Add(o);
                        }
                    }
                }
            }

            if (list != null)
            {
                if (list.Count > 0)
                {
                    list = (from w in list
                            orderby w.Rank ascending
                            select w).ToList();
                    this.gvGradingFactors.DataSource = list;
                    this.gvGradingFactors.DataBind();
                    this.UpdatePanel1.Update();
                }
            }
        }
Example #2
0
        protected void cboCommodity_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid CommodityGradeId = Guid.Empty;

            try
            {
                CommodityGradeId = new Guid(this.cboCommodity.SelectedValue.ToString());
            }
            catch
            {
                this.lblMsg.Text = "Please Select commodity Grade.";
                return;
            }
            if (CommodityGradeId != Guid.Empty)
            {
                GradingFactorBLL        obj  = new GradingFactorBLL();
                List <GradingFactorBLL> list = new List <GradingFactorBLL>();
                if (this.chkRecivedGrade.Checked == false)
                {
                    list = obj.GetGradingFactors(CommodityGradeId);
                }
                else
                {
                    list = null;
                }
                this.gvGradingFactors.DataSource = list;
                this.gvGradingFactors.DataBind();
            }
            else
            {
                this.lblMsg.Text = "Please Select commodity Grade.";
                return;
            }
            this.UpdatePanel1.Update();
        }
Example #3
0
        public void LoadGradingFactorsProductionYearChange()
        {
            Guid oldGradeId   = new Guid(ViewState["OldCommodityGrade"].ToString());
            Guid SelectedGuid = Guid.Empty;

            try
            {
                string   strTempCommGrade = this.cboCommodityGrade_CascadingDropDown.SelectedValue.ToString();
                string[] arrTemp          = strTempCommGrade.Split(':');
                SelectedGuid = new Guid(arrTemp[0].ToString());
            }
            catch
            {
            }


            // we need to Remove the Grading factors
            this.pnlGradingFactorsOld.Visible      = false;
            this.pnlGradingFactorsOld.GroupingText = "Old Grading Factor.";
            isGradeChanged = true;


            if (isGradeChanged == true)
            {
                this.pnlGradingFactorsNew.Visible = true;
                GradingFactorBLL        obj  = new GradingFactorBLL();
                List <GradingFactorBLL> list = new List <GradingFactorBLL>();
                list = (obj.GetGradingFactors(new Guid(this.cboCommodity.SelectedValue.ToString())));
                try
                {
                    list.AddRange(obj.GetGradingFactors(new Guid(this.cboCommodityGrade.SelectedValue.ToString())));
                    this.lblmsg2.Text = "";
                }
                catch
                {
                    if (this.chkRecivedGrade.Checked == true)
                    {
                        //  this.lblmsg2.Text = "Please check if all Grading Factors for the grade are displayed.";
                    }
                }

                this.gvGradingFactorsNew.DataSource = list;
                this.gvGradingFactorsNew.DataBind();
            }

            this.UpdatePanel1.Update();
        }
Example #4
0
        protected void chkRecivedGrade_CheckedChanged(object sender, EventArgs e)
        {
            if (this.chkRecivedGrade.Checked == true)
            {
                Guid CommodityGradeId = Guid.Empty;
                try
                {
                    CommodityGradeId = new Guid(this.cboCommodity.SelectedValue.ToString());
                }
                catch
                {
                    this.lblMsg.Text = "Please Select commodity Grade.";
                    return;
                }
                if (CommodityGradeId != Guid.Empty)
                {
                    GradingFactorBLL        obj  = new GradingFactorBLL();
                    List <GradingFactorBLL> list = new List <GradingFactorBLL>();
                    list = obj.GetGradingFactors(CommodityGradeId);
                    this.gvGradingFactors.DataSource = list;
                    this.gvGradingFactors.DataBind();
                }
                else
                {
                    this.lblMsg.Text = "Please Select commodity Grade.";
                    return;
                }

                this.UpdatePanel1.Update();
                this.cboStatus.Items.Clear();
                this.cboStatus.Items.Add(new ListItem("Please Select Status", ""));
                this.cboStatus.Items.Add(new ListItem("Approved", "1"));
                this.cboStatus.Items.Add(new ListItem("Cancelled", "2"));
            }
            else
            {
                this.gvGradingFactors.DataSource = null;
                this.gvGradingFactors.DataBind();
                this.cboCommodityGrade_CascadingDropDown.SelectedValue = "";
                if (this.cboCommodity.SelectedValue != "")
                {
                    LoadGradingFactors(new Guid(this.cboCommodity.SelectedValue.ToString()));
                }
                // remove Status
                this.cboStatus.Items.Clear();
                this.cboStatus.Items.Add(new ListItem("Please Select Status", ""));
                this.cboStatus.Items.Add(new ListItem("Moisture Fail", "5"));
                this.cboStatus.Items.Add(new ListItem("General Requierment fail", "6"));
            }
        }
Example #5
0
 private void LoadGradingFactors(Guid CommodityGradeId)
 {
     if (CommodityGradeId != Guid.Empty)
     {
         GradingFactorBLL        obj  = new GradingFactorBLL();
         List <GradingFactorBLL> list = new List <GradingFactorBLL>();
         list = obj.GetGradingFactors(CommodityGradeId);
         this.gvGradingFactors.DataSource = list;
         this.gvGradingFactors.DataBind();
     }
     else
     {
         this.lblMsg.Text = "Please Select commodity Grade.";
         return;
     }
     this.UpdatePanel1.Update();
 }