private void btn_Clear_Click(object sender, EventArgs e) { try { for (int i = 0; i < Chk_List_Client.ItemCount; i++) { Chk_List_Client.SetItemChecked(i, false); } for (int j = 0; j < Chk_List_Product_Type.ItemCount; j++) { Chk_List_Product_Type.SetItemChecked(j, false); } } catch (Exception ex) { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Something Went Wrong Please Check with Administrator.", "Warning", MessageBoxButtons.OK); } }
private void btn_Submit_Click(object sender, EventArgs e) { if (DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, "Are You Sure to Submit?", "Confirmation", MessageBoxButtons.YesNo) != DialogResult.No) { try { if (Chk_List_Client.CheckedItemsCount > 0 && Chk_List_Product_Type.CheckedItemsCount > 0) { for (int i = 0; i < Chk_List_Client.ItemCount; i++) { string Client_Check = Chk_List_Client.GetItemCheckState(i).ToString(); if (Client_Check == "Checked") { for (int j = 0; j < Chk_List_Product_Type.ItemCount; j++) { string Order_Type_Check = Chk_List_Product_Type.GetItemCheckState(j).ToString(); //string value = Chk_List_Client.GetItemValue(i).ToString(); //string value1 = Chk_List_Client.GetItemText(i).ToString(); if (Order_Type_Check == "Checked") { Hashtable ht_check = new Hashtable(); DataTable dt_check = new System.Data.DataTable(); ht_check.Add("@Trans", "CHECK"); ht_check.Add("@Client_Id", Chk_List_Client.GetItemValue(i).ToString()); ht_check.Add("@Order_Type_Id", Chk_List_Product_Type.GetItemValue(j).ToString()); ht_check.Add("@flag", "False"); dt_check = dataaccess.ExecuteSP("Sp_Tax_Order_Movement_Client_Product_Type", ht_check); int Check_Count = 0; if (dt_check.Rows.Count > 0) { Check_Count = int.Parse(dt_check.Rows[0]["COUNT"].ToString()); } else { Check_Count = 0; } if (Check_Count == 0) { Hashtable ht_Insert = new Hashtable(); DataTable dt_Insert = new System.Data.DataTable(); ht_Insert.Add("@Trans", "INSERT"); ht_Insert.Add("@Client_Id", Chk_List_Client.GetItemValue(i).ToString()); ht_Insert.Add("@Order_Type_Id", Chk_List_Product_Type.GetItemValue(j).ToString()); ht_Insert.Add("@Order_Assign_Status", "True"); ht_Insert.Add("@Inserted_By", User_Id); ht_Insert.Add("@Status", "True"); var Value = dataaccess.Execute_SP_Output_Return("Sp_Tax_Order_Movement_Client_Product_Type", ht_Insert); bool Result = bool.Parse(Value.ToString()); if (Result == true) { Record_Count = 1; //DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Record Added Sucessfully.", "Sucess", MessageBoxButtons.OK); } else { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Problem in Adding Record.", "Warning", MessageBoxButtons.OK); } } else if (Check_Count > 0) { Hashtable ht_Insert = new Hashtable(); DataTable dt_Insert = new System.Data.DataTable(); ht_Insert.Add("@Trans", "UPDATE"); ht_Insert.Add("@Client_Id", Chk_List_Client.GetItemValue(i).ToString()); ht_Insert.Add("@Order_Type_Id", Chk_List_Product_Type.GetItemValue(j).ToString()); ht_Insert.Add("@Order_Assign_Status", "True"); ht_Insert.Add("@Inserted_By", User_Id); ht_Insert.Add("@Status", "True"); var Value = dataaccess.Execute_SP_Output_Return("Sp_Tax_Order_Movement_Client_Product_Type", ht_Insert); bool Result = bool.Parse(Value.ToString()); if (Result == true) { Record_Count = 1; // DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Record Added Sucessfully.", "Sucess", MessageBoxButtons.OK); } else { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Problem in Adding Record.", "Warning", MessageBoxButtons.OK); } } } } } } if (Record_Count == 1) { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Record Added Sucessfully.", "Sucess", MessageBoxButtons.OK); GridView_BindTax_Client_Product_setup(); btn_Clear_Click(sender, e); } } else { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Please Select Client and Product Type.", "Warning", MessageBoxButtons.OK); } } catch (Exception ex) { DevExpress.XtraEditors.XtraMessageBox.Show(Default_Look_Confirmation.LookAndFeel, this, "Something Went Wrong Please Check with Administrator.", "Warning", MessageBoxButtons.OK); } } }