示例#1
0
        public void LoadGridDetails()
        {
            try
            {
                secRacBL = new SecRackMapBL();
                dt       = secRacBL.LoadGridDetails();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dataGridView1.Rows.Add();
                    dataGridView1["SectionRackId", i].Value = dt.Rows[i]["Sr_Id"];

                    //int sectionId = Convert.ToInt32(dt.Rows[i]["Sec_Id"]);
                    dataGridView1["SectionName", i].Value = dt.Rows[i]["Section Name"];

                    //int rackId = Convert.ToInt32(dt.Rows[i]["Rack_Id"]);
                    dataGridView1["RackName", i].Value = dt.Rows[i]["Rack Name"];

                    dataGridView1["PrintOrder", i].Value = dt.Rows[i]["Sr_Print"];
                    dataGridView1["Status", i].Value     = dt.Rows[i]["Sr_Status"].ToString() == "1" ? "Active" : "In Active";
                }

                lblCount.Text = Convert.ToString(dt.Rows.Count);
            }

            catch (Exception ex)
            {
                string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex);
                ErrorHandling.Class1.LogFileWrite(errorMessage);
            }
        }
示例#2
0
        public void UpdateSectionRackMapDetails()
        {
            try
            {
                secRac = new SectionRackMapMaster();
                secRac.sr_rac_map_id = Convert.ToInt32(txt_SecRac_ID.Text);
                secRac.racId         = cmbRackName.SelectedIndex + 1;
                secRac.secId         = cmbSectioName.SelectedIndex + 1;
                secRac.print         = Convert.ToInt32(txtPrint.Text);
                secRac.status        = cmbStatus.Text == "Active" ? 1 : 0;

                secRacBL = new SecRackMapBL();
                if (secRacBL.UpdateSecRacMapRecords(secRac) > 0)
                {
                    MessageBox.Show("Records Are Updated..", "Information", MessageBoxButtons.OK);
                }

                else
                {
                    MessageBox.Show("Records Are Not Updated..", "Information", MessageBoxButtons.OK);
                }
            }

            catch (Exception ex)
            {
                string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex);
                ErrorHandling.Class1.LogFileWrite(errorMessage);
                MessageBox.Show("Records Are Not Updated..", "Information", MessageBoxButtons.OK);
            }
        }
示例#3
0
        public void DeleteSectionRackMapDetails(int secRacId)
        {
            try
            {
                secRac = new SectionRackMapMaster();
                secRac.sr_rac_map_id = Convert.ToInt32(txt_SecRac_ID.Text);

                secRacBL = new SecRackMapBL();
                if (secRacBL.DeleteSectionRackMapDetails(secRacId) > 0)
                {
                    MessageBox.Show("Records Are Deleted..", "Information", MessageBoxButtons.OK);
                }

                else
                {
                    MessageBox.Show("Records Are Not Deleted..", "Information", MessageBoxButtons.OK);
                }
            }

            catch (Exception ex)
            {
                string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex);
                ErrorHandling.Class1.LogFileWrite(errorMessage);
                MessageBox.Show("Records Are Not Deleted..", "Information", MessageBoxButtons.OK);
            }
        }
示例#4
0
        public void LoadSecRacID()
        {
            try
            {
                secRacBL = new SecRackMapBL();
                int count = secRacBL.LoadSecRackMapId();
                txt_SecRac_ID.Text = Convert.ToString(++count);
            }

            catch (Exception ex)
            {
                string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex);
                ErrorHandling.Class1.LogFileWrite(errorMessage);
            }
        }
示例#5
0
        public void LoadSectionName()
        {
            try
            {
                secRacBL = new SecRackMapBL();
                dt       = secRacBL.LoadSectionName();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        cmbSectioName.Items.Add(dt.Rows[i]["Section Name"]);
                    }
                }
            }

            catch (Exception ex)
            {
                string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex);
                ErrorHandling.Class1.LogFileWrite(errorMessage);
                MessageBox.Show("Records Are Cannot be Displayed..", "Information", MessageBoxButtons.OK);
            }
        }