public ACC_ChartOfAccountLabel4 GetACC_ChartOfAccountLabel4FromReader(IDataReader reader) { try { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4 ( (int)reader["ACC_ChartOfAccountLabel4ID"], reader["Code"].ToString(), (int)reader["ACC_HeadTypeID"], reader["ChartOfAccountLabel4Text"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"], (int)reader["RowStatusID"] ); return aCC_ChartOfAccountLabel4; } catch(Exception ex) { return null; } }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(hfaCC_ChartOfAccountLabel4ID.Value)); ACC_ChartOfAccountLabel4 tempACC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); tempACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; tempACC_ChartOfAccountLabel4.Code = txtCode.Text; tempACC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); tempACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; tempACC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; tempACC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; tempACC_ChartOfAccountLabel4.ExtraField3 = ddlACC_HeadType.SelectedValue == "10" ? (ddlCOAL3.SelectedValue == "0" ? "203" : ddlCOAL3.SelectedValue) : txtExtraField3.Text; tempACC_ChartOfAccountLabel4.AddedBy = getLogin().LoginID; tempACC_ChartOfAccountLabel4.AddedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.UpdatedBy = getLogin().LoginID; tempACC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); bool result = ACC_ChartOfAccountLabel4Manager.UpdateACC_ChartOfAccountLabel4(tempACC_ChartOfAccountLabel4); showACC_ChartOfAccountLabel4Grid(); btnUpdate.Visible = false; btnAdd.Visible = true; btnClear_Click(this, new EventArgs()); }
public ACC_ChartOfAccountLabel4 GetACC_ChartOfAccountLabel4FromReader(IDataReader reader) { try { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4 ( (int)reader["ACC_ChartOfAccountLabel4ID"], reader["Code"].ToString(), (int)reader["ACC_HeadTypeID"], reader["ChartOfAccountLabel4Text"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"], (int)reader["RowStatusID"] ); return(aCC_ChartOfAccountLabel4); } catch (Exception ex) { return(null); } }
private void showACC_ChartOfAccountLabel4Data() { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(hfaCC_ChartOfAccountLabel4ID.Value)); txtCode.Text = aCC_ChartOfAccountLabel4.Code; ddlACC_HeadType.SelectedValue = aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString(); txtChartOfAccountLabel4Text.Text = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; txtExtraField1.Text = aCC_ChartOfAccountLabel4.ExtraField1; txtExtraField2.Text = aCC_ChartOfAccountLabel4.ExtraField2; txtExtraField3.Text = aCC_ChartOfAccountLabel4.ExtraField3; txtAddedBy.Text = aCC_ChartOfAccountLabel4.AddedBy.ToString(); txtUpdatedBy.Text = aCC_ChartOfAccountLabel4.UpdatedBy.ToString(); //txtUpdatedDate.Text = aCC_ChartOfAccountLabel4.UpdatedDate; ddlRowStatus.SelectedValue = aCC_ChartOfAccountLabel4.RowStatusID.ToString(); if (ddlACC_HeadType.SelectedValue == "10") { ddlCOAL3.Visible = true; try { ddlCOAL3.SelectedValue = aCC_ChartOfAccountLabel4.ExtraField3; } catch (Exception ex) { } txtExtraField3.Enabled = false; } else { txtExtraField3.Enabled = true; ddlCOAL3.Visible = false; } }
public static ACC_ChartOfAccountLabel4 GetACC_ChartOfAccountLabel4ByID(int id) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); aCC_ChartOfAccountLabel4 = sqlACC_ChartOfAccountLabel4Provider.GetACC_ChartOfAccountLabel4ByID(id); return aCC_ChartOfAccountLabel4; }
public static ACC_ChartOfAccountLabel4 GetACC_ChartOfAccountLabel4ByID(int id) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); aCC_ChartOfAccountLabel4 = sqlACC_ChartOfAccountLabel4Provider.GetACC_ChartOfAccountLabel4ByID(id); return(aCC_ChartOfAccountLabel4); }
private void showACC_ChartOfAccountLabel4Data() { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(Request.QueryString["aCC_ChartOfAccountLabel4ID"])); txtCode.Text = aCC_ChartOfAccountLabel4.Code; ddlACC_HeadType.SelectedValue = aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString(); txtChartOfAccountLabel4Text.Text = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; txtExtraField1.Text = aCC_ChartOfAccountLabel4.ExtraField1; txtExtraField2.Text = aCC_ChartOfAccountLabel4.ExtraField2; txtExtraField3.Text = aCC_ChartOfAccountLabel4.ExtraField3; txtAddedBy.Text = aCC_ChartOfAccountLabel4.AddedBy.ToString(); txtUpdatedBy.Text = aCC_ChartOfAccountLabel4.UpdatedBy.ToString(); txtUpdatedDate.Text = aCC_ChartOfAccountLabel4.UpdatedDate; ddlRowStatus.SelectedValue = aCC_ChartOfAccountLabel4.RowStatusID.ToString(); }
protected void btnAdd_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4.Code = txtCode.Text; aCC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; aCC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; aCC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; aCC_ChartOfAccountLabel4.ExtraField3 = txtExtraField3.Text; aCC_ChartOfAccountLabel4.AddedBy = Int32.Parse(txtAddedBy.Text); aCC_ChartOfAccountLabel4.AddedDate = DateTime.Now; aCC_ChartOfAccountLabel4.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); aCC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; aCC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); int resutl = ACC_ChartOfAccountLabel4Manager.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); Response.Redirect("AdminACC_ChartOfAccountLabel4Display.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4.Code = txtCode.Text; aCC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; aCC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; aCC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; aCC_ChartOfAccountLabel4.ExtraField3 = txtExtraField3.Text; aCC_ChartOfAccountLabel4.AddedBy = Int32.Parse(txtAddedBy.Text); aCC_ChartOfAccountLabel4.AddedDate = DateTime.Now; aCC_ChartOfAccountLabel4.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); aCC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; aCC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); int resutl = ACC_ChartOfAccountLabel4Manager.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); Response.Redirect("AdminACC_ChartOfAccountLabel4Display.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4.Code = txtCode.Text; aCC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; aCC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; aCC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; aCC_ChartOfAccountLabel4.ExtraField3 = ddlACC_HeadType.SelectedValue == "10" ? (ddlCOAL3.SelectedValue == "0" ? "203" : ddlCOAL3.SelectedValue) : txtExtraField3.Text; aCC_ChartOfAccountLabel4.AddedBy = getLogin().LoginID; aCC_ChartOfAccountLabel4.AddedDate = DateTime.Now; aCC_ChartOfAccountLabel4.UpdatedBy = getLogin().LoginID; aCC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; aCC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); int resutl = ACC_ChartOfAccountLabel4Manager.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); showACC_ChartOfAccountLabel4Grid(); btnClear_Click(this, new EventArgs()); }
protected void btnAdd_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4.Code = txtCode.Text; aCC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; aCC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; aCC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; aCC_ChartOfAccountLabel4.ExtraField3 = ddlACC_HeadType.SelectedValue == "10" ? (ddlCOAL3.SelectedValue == "0" ? "203" : ddlCOAL3.SelectedValue) : txtExtraField3.Text; aCC_ChartOfAccountLabel4.AddedBy = getLogin().LoginID; aCC_ChartOfAccountLabel4.AddedDate = DateTime.Now; aCC_ChartOfAccountLabel4.UpdatedBy = getLogin().LoginID; aCC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; aCC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); int resutl = ACC_ChartOfAccountLabel4Manager.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); showACC_ChartOfAccountLabel4Grid(); btnClear_Click(this, new EventArgs()); }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(Request.QueryString["aCC_ChartOfAccountLabel4ID"])); ACC_ChartOfAccountLabel4 tempACC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); tempACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; tempACC_ChartOfAccountLabel4.Code = txtCode.Text; tempACC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); tempACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; tempACC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; tempACC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; tempACC_ChartOfAccountLabel4.ExtraField3 = txtExtraField3.Text; tempACC_ChartOfAccountLabel4.AddedBy = Int32.Parse(txtAddedBy.Text); tempACC_ChartOfAccountLabel4.AddedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); tempACC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); bool result = ACC_ChartOfAccountLabel4Manager.UpdateACC_ChartOfAccountLabel4(tempACC_ChartOfAccountLabel4); Response.Redirect("AdminACC_ChartOfAccountLabel4Display.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(Request.QueryString["aCC_ChartOfAccountLabel4ID"])); ACC_ChartOfAccountLabel4 tempACC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); tempACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; tempACC_ChartOfAccountLabel4.Code = txtCode.Text; tempACC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); tempACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; tempACC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; tempACC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; tempACC_ChartOfAccountLabel4.ExtraField3 = txtExtraField3.Text; tempACC_ChartOfAccountLabel4.AddedBy = Int32.Parse(txtAddedBy.Text); tempACC_ChartOfAccountLabel4.AddedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); tempACC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); bool result = ACC_ChartOfAccountLabel4Manager.UpdateACC_ChartOfAccountLabel4(tempACC_ChartOfAccountLabel4); Response.Redirect("AdminACC_ChartOfAccountLabel4Display.aspx"); }
public bool UpdateACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdateACC_ChartOfAccountLabel4", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ACC_ChartOfAccountLabel4ID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; cmd.Parameters.Add("@Code", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.Code; cmd.Parameters.Add("@ACC_HeadTypeID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.ACC_HeadTypeID; cmd.Parameters.Add("@ChartOfAccountLabel4Text", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField3; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = aCC_ChartOfAccountLabel4.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = aCC_ChartOfAccountLabel4.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
private void loadACC_ChartOfAccountLabel4() { ddlAllACC_ChartOfAccountLabel4.Items.Add(new ListItem("Select", "0")); List <ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4s = new List <ACC_ChartOfAccountLabel4>(); List <ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4sBranches = new List <ACC_ChartOfAccountLabel4>(); List <ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4sBanks = new List <ACC_ChartOfAccountLabel4>(); //aCC_ChartOfAccountLabel4s = ACC_ChartOfAccountLabel4Manager.GetAllACC_ChartOfAccountLabel4sForJournalEntry(); string sql = @" SELECT ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID] ,ACC_ChartOfAccountLabel4.[Code] ,ACC_ChartOfAccountLabel4.[ACC_HeadTypeID] ,ACC_HeadType.HeadTypeName +' -> '+ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] as ChartOfAccountLabel4Text --,ACC_HeadType.HeadTypeName +' -> '+ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] as ChartOfAccountLabel4Text ,ACC_ChartOfAccountLabel4.[ExtraField1] ,ACC_ChartOfAccountLabel4.[ExtraField2] ,ACC_ChartOfAccountLabel4.[ExtraField3] ,ACC_ChartOfAccountLabel4.[AddedBy] ,ACC_ChartOfAccountLabel4.[AddedDate] ,ACC_ChartOfAccountLabel4.[UpdatedBy] ,ACC_ChartOfAccountLabel4.[UpdatedDate] ,ACC_ChartOfAccountLabel4.[RowStatusID] ,ACC_ChartOfAccountLabel4Visibility.IsVisible FROM ACC_ChartOfAccountLabel4 inner join ACC_HeadType on ACC_HeadType.ACC_HeadTypeID=ACC_ChartOfAccountLabel4.ACC_HeadTypeID left outer join ACC_ChartOfAccountLabel4Visibility on ACC_ChartOfAccountLabel4Visibility.ACC_ChartOfAccountLabel4ID =ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID] where ACC_ChartOfAccountLabel4.[RowStatusID] =1 order by ACC_HeadType.ACC_HeadTypeID,ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] "; DataSet ds = CommonManager.SQLExec(sql); foreach (DataRow dr in ds.Tables[0].Rows) { try { dr["IsVisible"] = bool.Parse(dr["IsVisible"].ToString()); } catch (Exception ex) { dr["IsVisible"] = false; } if (!bool.Parse(dr["IsVisible"].ToString())) { ACC_ChartOfAccountLabel4 l4 = new ACC_ChartOfAccountLabel4(); l4.ACC_ChartOfAccountLabel4ID = int.Parse(dr["ACC_ChartOfAccountLabel4ID"].ToString()); l4.ACC_HeadTypeID = int.Parse(dr["ACC_HeadTypeID"].ToString()); l4.ChartOfAccountLabel4Text = dr["ChartOfAccountLabel4Text"].ToString(); aCC_ChartOfAccountLabel4s.Add(l4); } } List <ACC_HeadType> allACC_HeadType = ACC_HeadTypeManager.GetAllACC_HeadTypes(); foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4s) { /* * ACC_HeadTypeID HeadTypeName * 1 Work Station * 2 Raw Materials * 3 Products * 4 Employee * 5 Bank Account * 6 Supplier * 7 ShareHolder * 8 Others */ if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1 && aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.Contains("Show")) { aCC_ChartOfAccountLabel4sBranches.Add(aCC_ChartOfAccountLabel4); } if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 5) { aCC_ChartOfAccountLabel4sBanks.Add(aCC_ChartOfAccountLabel4); } if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 4 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 5 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 6 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 8 ) { //foreach (ACC_HeadType aCC_HeadType in allACC_HeadType) //{ // if (aCC_HeadType.ACC_HeadTypeID == aCC_ChartOfAccountLabel4.ACC_HeadTypeID) // { // aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = aCC_HeadType.HeadTypeName+" -> "+ aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; // } //} ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()); ddlAllACC_ChartOfAccountLabel4.Items.Add(item); } } gvACC_ChartOfAccountLabel4.DataSource = aCC_ChartOfAccountLabel4sBranches; gvACC_ChartOfAccountLabel4.DataBind(); foreach (GridViewRow gvr in gvACC_ChartOfAccountLabel4.Rows) { DropDownList ddlBanks = (DropDownList)gvr.FindControl("ddlBanks"); ddlBanks.Items.Add(new ListItem("select bank acc", "0")); foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4sBanks) { ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString().Split('>')[1], aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()); ddlBanks.Items.Add(item); } } }
private void showACC_ChartOfAccountLabel4Data() { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(hfaCC_ChartOfAccountLabel4ID.Value)); txtCode.Text = aCC_ChartOfAccountLabel4.Code; ddlACC_HeadType.SelectedValue = aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString(); txtChartOfAccountLabel4Text.Text = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; txtExtraField1.Text = aCC_ChartOfAccountLabel4.ExtraField1; txtExtraField2.Text = aCC_ChartOfAccountLabel4.ExtraField2; txtExtraField3.Text = aCC_ChartOfAccountLabel4.ExtraField3; txtAddedBy.Text = aCC_ChartOfAccountLabel4.AddedBy.ToString(); txtUpdatedBy.Text = aCC_ChartOfAccountLabel4.UpdatedBy.ToString(); //txtUpdatedDate.Text = aCC_ChartOfAccountLabel4.UpdatedDate; ddlRowStatus.SelectedValue = aCC_ChartOfAccountLabel4.RowStatusID.ToString(); if (ddlACC_HeadType.SelectedValue == "10") { ddlCOAL3.Visible = true; try { ddlCOAL3.SelectedValue = aCC_ChartOfAccountLabel4.ExtraField3; } catch (Exception ex) { } txtExtraField3.Enabled = false; } else { txtExtraField3.Enabled = true; ddlCOAL3.Visible = false; } }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(hfaCC_ChartOfAccountLabel4ID.Value)); ACC_ChartOfAccountLabel4 tempACC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); tempACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; tempACC_ChartOfAccountLabel4.Code = txtCode.Text; tempACC_ChartOfAccountLabel4.ACC_HeadTypeID = Int32.Parse(ddlACC_HeadType.SelectedValue); tempACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = txtChartOfAccountLabel4Text.Text; tempACC_ChartOfAccountLabel4.ExtraField1 = txtExtraField1.Text; tempACC_ChartOfAccountLabel4.ExtraField2 = txtExtraField2.Text; tempACC_ChartOfAccountLabel4.ExtraField3 = ddlACC_HeadType.SelectedValue == "10" ? (ddlCOAL3.SelectedValue == "0" ? "203" : ddlCOAL3.SelectedValue) : txtExtraField3.Text; tempACC_ChartOfAccountLabel4.AddedBy = getLogin().LoginID; tempACC_ChartOfAccountLabel4.AddedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.UpdatedBy = getLogin().LoginID; tempACC_ChartOfAccountLabel4.UpdatedDate = DateTime.Now; tempACC_ChartOfAccountLabel4.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); bool result = ACC_ChartOfAccountLabel4Manager.UpdateACC_ChartOfAccountLabel4(tempACC_ChartOfAccountLabel4); showACC_ChartOfAccountLabel4Grid(); btnUpdate.Visible = false; btnAdd.Visible = true; btnClear_Click(this, new EventArgs()); }
public static int InsertACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); return(sqlACC_ChartOfAccountLabel4Provider.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4)); }
private void loadACC_ChartOfAccountLabel4() { ddlAllACC_ChartOfAccountLabel4.Items.Add(new ListItem("Select", "0")); List<ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4s = new List<ACC_ChartOfAccountLabel4>(); List<ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4sBranches = new List<ACC_ChartOfAccountLabel4>(); List<ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4sBanks = new List<ACC_ChartOfAccountLabel4>(); //aCC_ChartOfAccountLabel4s = ACC_ChartOfAccountLabel4Manager.GetAllACC_ChartOfAccountLabel4sForJournalEntry(); string sql = @" SELECT ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID] ,ACC_ChartOfAccountLabel4.[Code] ,ACC_ChartOfAccountLabel4.[ACC_HeadTypeID] ,ACC_HeadType.HeadTypeName +' -> '+ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] as ChartOfAccountLabel4Text --,ACC_HeadType.HeadTypeName +' -> '+ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] as ChartOfAccountLabel4Text ,ACC_ChartOfAccountLabel4.[ExtraField1] ,ACC_ChartOfAccountLabel4.[ExtraField2] ,ACC_ChartOfAccountLabel4.[ExtraField3] ,ACC_ChartOfAccountLabel4.[AddedBy] ,ACC_ChartOfAccountLabel4.[AddedDate] ,ACC_ChartOfAccountLabel4.[UpdatedBy] ,ACC_ChartOfAccountLabel4.[UpdatedDate] ,ACC_ChartOfAccountLabel4.[RowStatusID] ,ACC_ChartOfAccountLabel4Visibility.IsVisible FROM ACC_ChartOfAccountLabel4 inner join ACC_HeadType on ACC_HeadType.ACC_HeadTypeID=ACC_ChartOfAccountLabel4.ACC_HeadTypeID left outer join ACC_ChartOfAccountLabel4Visibility on ACC_ChartOfAccountLabel4Visibility.ACC_ChartOfAccountLabel4ID =ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID] where ACC_ChartOfAccountLabel4.[RowStatusID] =1 order by ACC_HeadType.ACC_HeadTypeID,ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] "; DataSet ds = CommonManager.SQLExec(sql); foreach (DataRow dr in ds.Tables[0].Rows) { try { dr["IsVisible"] = bool.Parse(dr["IsVisible"].ToString()); } catch (Exception ex) { dr["IsVisible"] = false; } if (!bool.Parse(dr["IsVisible"].ToString())) { ACC_ChartOfAccountLabel4 l4 = new ACC_ChartOfAccountLabel4(); l4.ACC_ChartOfAccountLabel4ID = int.Parse(dr["ACC_ChartOfAccountLabel4ID"].ToString()); l4.ACC_HeadTypeID = int.Parse(dr["ACC_HeadTypeID"].ToString()); l4.ChartOfAccountLabel4Text = dr["ChartOfAccountLabel4Text"].ToString(); aCC_ChartOfAccountLabel4s.Add(l4); } } List<ACC_HeadType> allACC_HeadType= ACC_HeadTypeManager.GetAllACC_HeadTypes(); foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4s) { /* ACC_HeadTypeID HeadTypeName 1 Work Station 2 Raw Materials 3 Products 4 Employee 5 Bank Account 6 Supplier 7 ShareHolder 8 Others */ if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1 && aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.Contains("Show")) { aCC_ChartOfAccountLabel4sBranches.Add(aCC_ChartOfAccountLabel4); } if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 5) { aCC_ChartOfAccountLabel4sBanks.Add(aCC_ChartOfAccountLabel4); } if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 4 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 5 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 6 || aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 8 ) { //foreach (ACC_HeadType aCC_HeadType in allACC_HeadType) //{ // if (aCC_HeadType.ACC_HeadTypeID == aCC_ChartOfAccountLabel4.ACC_HeadTypeID) // { // aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text = aCC_HeadType.HeadTypeName+" -> "+ aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; // } //} ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()); ddlAllACC_ChartOfAccountLabel4.Items.Add(item); } } gvACC_ChartOfAccountLabel4.DataSource = aCC_ChartOfAccountLabel4sBranches; gvACC_ChartOfAccountLabel4.DataBind(); foreach (GridViewRow gvr in gvACC_ChartOfAccountLabel4.Rows) { DropDownList ddlBanks = (DropDownList)gvr.FindControl("ddlBanks"); ddlBanks.Items.Add(new ListItem("select bank acc","0")); foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4sBanks) { ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString().Split('>')[1], aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()); ddlBanks.Items.Add(item); } } }
private void showACC_ChartOfAccountLabel4Data() { ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 = new ACC_ChartOfAccountLabel4(); aCC_ChartOfAccountLabel4 = ACC_ChartOfAccountLabel4Manager.GetACC_ChartOfAccountLabel4ByID(Int32.Parse(Request.QueryString["aCC_ChartOfAccountLabel4ID"])); txtCode.Text = aCC_ChartOfAccountLabel4.Code; ddlACC_HeadType.SelectedValue = aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString(); txtChartOfAccountLabel4Text.Text = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; txtExtraField1.Text = aCC_ChartOfAccountLabel4.ExtraField1; txtExtraField2.Text = aCC_ChartOfAccountLabel4.ExtraField2; txtExtraField3.Text = aCC_ChartOfAccountLabel4.ExtraField3; txtAddedBy.Text = aCC_ChartOfAccountLabel4.AddedBy.ToString(); txtUpdatedBy.Text = aCC_ChartOfAccountLabel4.UpdatedBy.ToString(); txtUpdatedDate.Text = aCC_ChartOfAccountLabel4.UpdatedDate; ddlRowStatus.SelectedValue = aCC_ChartOfAccountLabel4.RowStatusID.ToString(); }
public static int InsertACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); return sqlACC_ChartOfAccountLabel4Provider.InsertACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); }
public static bool UpdateACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); return sqlACC_ChartOfAccountLabel4Provider.UpdateACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4); }
public static bool UpdateACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { SqlACC_ChartOfAccountLabel4Provider sqlACC_ChartOfAccountLabel4Provider = new SqlACC_ChartOfAccountLabel4Provider(); return(sqlACC_ChartOfAccountLabel4Provider.UpdateACC_ChartOfAccountLabel4(aCC_ChartOfAccountLabel4)); }
public bool UpdateACC_ChartOfAccountLabel4(ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdateACC_ChartOfAccountLabel4", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ACC_ChartOfAccountLabel4ID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID; cmd.Parameters.Add("@Code", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.Code; cmd.Parameters.Add("@ACC_HeadTypeID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.ACC_HeadTypeID; cmd.Parameters.Add("@ChartOfAccountLabel4Text", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = aCC_ChartOfAccountLabel4.ExtraField3; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = aCC_ChartOfAccountLabel4.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = aCC_ChartOfAccountLabel4.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = aCC_ChartOfAccountLabel4.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }