예제 #1
0
        private void addDistrictSaveBtn_Click(object sender, EventArgs e)
        {
            String STATE    = stateSelected;
            String DISTRICT = distName_Txt.Text.ToString();

            if (String.IsNullOrEmpty(STATE))
            {
                errorProvider1.SetError(addDistrictStateComboBox, "Select State!");
                return;
            }
            if (String.IsNullOrEmpty(DISTRICT))
            {
                errorProvider1.SetError(distName_Txt, "Enter District Name");
                return;
            }
            if (Validation.IsContainSPace((DISTRICT)))
            {
                errorProvider1.SetError(distName_Txt, "Enter DIstrict Without Space");
                return;
            }
            DataLoadUtility dataLoadUtility = new DataLoadUtility();
            String          districtId      = distName_Txt.Text.ToString().Substring(0, 2) + distName_Txt.Text.ToString();
            String          sqlQuery        = "insert into district values ('" + districtId + "','" + STATE + "','" + DISTRICT + "');";

            if (!(dataLoadUtility.insertData(sqlQuery)))
            {
                MessageBox.Show("District Not Saved");
            }
            else
            {
                MessageBox.Show("District Saved");
                this.Close();
            }
        }
예제 #2
0
        private void addStateSaveBtn_Click(object sender, EventArgs e)
        {
            String STATE = stateName_Txt.Text.ToString();

            if (String.IsNullOrEmpty(STATE))
            {
                errorProvider1.SetError(stateName_Txt, "Enter State!");
                return;
            }
            if (Validation.IsContainSPace((STATE)))
            {
                errorProvider1.SetError(stateName_Txt, "Enter Stace Without Space");
                return;
            }
            DataLoadUtility dataLoadUtility = new DataLoadUtility();
            String          stateId         = stateName_Txt.Text.ToString().Substring(0, 2) + stateName_Txt.Text.ToString();
            String          sqlQuery        = "insert into state values ('" + stateId + "','" + STATE + "');";

            if (!(dataLoadUtility.insertData(sqlQuery)))
            {
                MessageBox.Show("State Not Saved");
            }
            else
            {
                MessageBox.Show("State Saved");

                this.Close();
            }
        }
예제 #3
0
        private void addItemSaveBtn_Click(object sender, EventArgs e)
        {
            String ITEM_CATEGORY = itemCategorySelected;
            String ITEM_NAME     = itemNameTxt.Text.ToString();

            if (String.IsNullOrEmpty(ITEM_CATEGORY))
            {
                errorProvider1.SetError(addItemCategorycomboBox, "Select Item Category First !");
                return;
            }
            if (String.IsNullOrEmpty(ITEM_NAME))
            {
                errorProvider1.SetError(itemNameTxt, "Enter Item Name");
                return;
            }
            DataLoadUtility dataLoadUtility = new DataLoadUtility();
            String          ITEM_ID         = GenerateUniqueID.RandomString(5);
            String          sqlQuery        = "insert into item_details values ('" + ITEM_ID + "','" + ITEM_NAME + "','" + ITEM_CATEGORY + "');";

            if (!(dataLoadUtility.insertData(sqlQuery)))
            {
                MessageBox.Show("Item  Not Saved");
            }
            else
            {
                MessageBox.Show("Item Saved");
                this.Close();
            }
        }
예제 #4
0
        private void addAreaSaveBtn_Click(object sender, EventArgs e)
        {
            String STATE    = stateSelected;
            String DISTRICT = distSelected;
            String AREA     = areaName_Txt.Text.ToString();

            if (String.IsNullOrEmpty(STATE))
            {
                errorProvider1.SetError(addAreaStatecomboBox, "Select State!");
                return;
            }
            if (String.IsNullOrEmpty(DISTRICT))
            {
                errorProvider1.SetError(addAreaDistrictcomboBox, "Select District!");
                return;
            }
            if (String.IsNullOrEmpty(AREA))
            {
                errorProvider1.SetError(areaName_Txt, "Enter Area!");
                return;
            }
            if (Validation.IsContainSPace((AREA)))
            {
                errorProvider1.SetError(areaName_Txt, "Enter Area Without Space");
                return;
            }
            DataLoadUtility dataLoadUtility = new DataLoadUtility();
            String          areaId          = areaName_Txt.Text.ToString().Substring(0, 2) + areaName_Txt.Text.ToString();
            String          sqlQuery        = "insert into area values ('" + areaId + "','" + STATE + "','" + DISTRICT + "','" + AREA + "');";

            if (!(dataLoadUtility.insertData(sqlQuery)))
            {
                MessageBox.Show("Area Not Saved");
            }
            else
            {
                MessageBox.Show("Area Saved");
                this.Close();
            }
        }