public static int addAccountSubGroup(AccountSubGroup accountSubGroup) { try { int i = accountGroupProvider.addAccountSubGroup(accountSubGroup); return(i); } catch (Exception ae) { throw ae; } }
protected void view_Click(object sender, EventArgs e) { if (Session["UserName"] != null) { AccountSubGroup sa = new AccountSubGroup(); sa.AutoId = Convert.ToInt32(Id.Text); sa.Main_Code = Convert.ToInt32(ddllist.SelectedValue); sa.Sub_HEAD = txtsub.Text.Trim(); sa.Inactive = Convert.ToBoolean(true); sa.Save(); MessageBox("Record saved successfully"); txtsub.Text = ""; ddllist.SelectedValue = "0"; SetView(); } }
public static int addAccountSubGroup(AccountSubGroup accountSubGroup) { try { List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >(); parameter.Add(new KeyValuePair <string, object>("@accountSubGroupId", accountSubGroup.accountSubGroupId)); parameter.Add(new KeyValuePair <string, object>("@accountGroupId", accountSubGroup.accountGroupId)); parameter.Add(new KeyValuePair <string, object>("@accountSubGroupName", accountSubGroup.accountSubGroupName)); parameter.Add(new KeyValuePair <string, object>("@isUpDate", accountSubGroup.isUpDate)); parameter.Add(new KeyValuePair <string, object>("@isDelete", accountSubGroup.isDelete)); SqlHandler sqlH = new SqlHandler(); int i = sqlH.ExecuteNonQueryI("[dbo].[Usp_addAccountSubGroup]", parameter); return(i); } catch (Exception ae) { throw ae; } }
private void btnSave_Click(object sender, EventArgs e) { try { if (cmbaccoutType.SelectedIndex == 0) { if (Utility.Langn == "English") { MessageBox.Show("Please Select Account Group...!"); } else { MessageBox.Show("कृपया खाते गट निवडा ...!"); } cmbaccoutType.Focus(); return; } if (cmbAccountGroup.SelectedIndex == 0) { if (Utility.Langn == "English") { MessageBox.Show("Please Select Account Group Type...!"); } else { MessageBox.Show("कृपया खाते गट प्रकार निवडा"); } cmbAccountGroup.Focus(); return; } if (txtAccountGroup.Text == string.Empty) { if (Utility.Langn == "English") { MessageBox.Show("Please Select Account Group SubGroup...!"); } else { MessageBox.Show("कृपया खाते गट प्रकार भरा"); } txtAccountGroup.Focus(); return; } AccountSubGroup accountSubGroup = new AccountSubGroup(); accountSubGroup.accountSubGroupId = accountSubGrpId; accountSubGroup.accountGroupId = Convert.ToInt64(cmbAccountGroup.SelectedValue); accountSubGroup.accountSubGroupName = txtAccountGroup.Text.Trim(); accountSubGroup.isDelete = isDelete; accountSubGroup.isUpDate = isUpDate; int i = accountGroupController.addAccountSubGroup(accountSubGroup); if (i > 0) { if (isDelete == false && isUpDate == false) { if (Utility.Langn == "English") { MessageBox.Show("Record Saved Successfully ...!"); } else { MessageBox.Show("सदर नोंद यशस्वीरीत्या साठवली गेली आहे."); } } if (isDelete == false && isUpDate == true) { if (Utility.Langn == "English") { MessageBox.Show("Record Updated Successfully ...!"); } else { MessageBox.Show("सदर नोंद यशस्वीरीत्या अपडेट केली गेली आहे."); } } if (isDelete == true && isUpDate == false) { if (Utility.Langn == "English") { MessageBox.Show("Record Deleted Successfully ...!"); } else { MessageBox.Show("सदर नोंद यशस्वीरीत्या डिलीट केली गेली आहे."); } } btnNew_Click(sender, e); } if (i == -1) { if (isDelete != false) { if (Utility.Langn == "English") { MessageBox.Show("Record alredy exists ...!"); } else { MessageBox.Show("सदर नोंद उपलब्ध आहे."); } } } } catch (Exception ae) { MessageBox.Show("Error" + ae.ToString()); } }