public static ACC_Head GetCOMN_RowStatusByRowStatusID(int RowStatusID) { ACC_Head aCC_Head = new ACC_Head(); SqlACC_HeadProvider sqlACC_HeadProvider = new SqlACC_HeadProvider(); aCC_Head = sqlACC_HeadProvider.GetACC_HeadByRowStatusID(RowStatusID); return aCC_Head; }
public static ACC_Head GetACC_AccountByAccountID(int AccountID) { ACC_Head aCC_Head = new ACC_Head(); SqlACC_HeadProvider sqlACC_HeadProvider = new SqlACC_HeadProvider(); aCC_Head = sqlACC_HeadProvider.GetACC_HeadByAccountID(AccountID); return aCC_Head; }
public static ACC_Head GetACC_HeadByHeadID(int HeadID) { ACC_Head aCC_Head = new ACC_Head(); SqlACC_HeadProvider sqlACC_HeadProvider = new SqlACC_HeadProvider(); aCC_Head = sqlACC_HeadProvider.GetACC_HeadByHeadID(HeadID); return aCC_Head; }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_Head aCC_Head = new ACC_Head (); aCC_Head.HeadID= int.Parse(Request.QueryString["ID"].ToString()); aCC_Head.HeadName= txtHeadName.Text; aCC_Head.HeadCode= txtHeadCode.Text; aCC_Head.AccountID= int.Parse(ddlAccountID.SelectedValue); aCC_Head.AddedBy= Profile.card_id; aCC_Head.AddedDate= DateTime.Now; aCC_Head.UpdatedBy= Profile.card_id; aCC_Head.UpdateDate= DateTime.Now; aCC_Head.RowStatusID= int.Parse(ddlRowStatusID.SelectedValue); bool resutl =ACC_HeadManager.UpdateACC_Head(aCC_Head); Response.Redirect("AdminDisplayACC_Head.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { ACC_Head aCC_Head = new ACC_Head (); // aCC_Head.HeadID= int.Parse(ddlHeadID.SelectedValue); aCC_Head.HeadName= txtHeadName.Text; aCC_Head.HeadCode= txtHeadCode.Text; aCC_Head.AccountID= int.Parse(ddlAccountID.SelectedValue); aCC_Head.AddedBy= Profile.card_id; aCC_Head.AddedDate= DateTime.Now; aCC_Head.UpdatedBy= Profile.card_id; aCC_Head.UpdateDate= DateTime.Now; aCC_Head.RowStatusID= int.Parse(ddlRowStatusID.SelectedValue); int resutl =ACC_HeadManager.InsertACC_Head(aCC_Head); Response.Redirect("AdminDisplayACC_Head.aspx"); }
private void getHeadMoney(bool IsNewCompany) { string UserID = ""; string UserName = ""; if (ddlAccountingUserMoney.Visible != false) { UserID = ddlAccountingUserMoney.SelectedValue; UserName = ddlAccountingUserMoney.SelectedItem.Text; } else { UserID = txtStudentCodeMoney.Text; UserName = txtStudentCodeMoney.Text; } if (IsNewCompany) { ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser(); // aCC_AccountingUser.AccountingUserID= int.Parse(ddlAccountingUserID.SelectedValue); aCC_AccountingUser.AccountingUserName = txtNewCompanyMoney.Text; UserName = txtNewCompanyMoney.Text; aCC_AccountingUser.UserTypeID = int.Parse(ddlUserTypeIDMoney.SelectedValue); aCC_AccountingUser.AddedBy = Profile.card_id; aCC_AccountingUser.AddedDate = DateTime.Now; aCC_AccountingUser.UpdatedBy = Profile.card_id; aCC_AccountingUser.UpdateDate = DateTime.Now; aCC_AccountingUser.RowStatusID = 1; UserID = ACC_AccountingUserManager.InsertACC_AccountingUser(aCC_AccountingUser).ToString(); } DataSet dsHeadUser = ACC_HeadUserManager.GetACC_UserByUserIDnUserTypeIDnAccountID(UserID, int.Parse(ddlUserTypeIDMoney.SelectedValue), int.Parse(ddlAccountForMoney.SelectedValue)); int HeadID = 0; string headNameMoney = ""; if (dsHeadUser.Tables[0].Rows.Count == 0) { //need to create the dead for this user ACC_Head aCC_Head = new ACC_Head(); // aCC_Head.HeadID= int.Parse(ddlHeadID.SelectedValue); aCC_Head.HeadName = ddlAccountForMoney.SelectedItem.Text + " --> " + UserName; headNameMoney = aCC_Head.HeadName; aCC_Head.HeadCode = ""; //code need to generate automatically aCC_Head.AccountID = int.Parse(ddlAccountID.SelectedValue); aCC_Head.AddedBy = Profile.card_id; aCC_Head.AddedDate = DateTime.Now; aCC_Head.UpdatedBy = Profile.card_id; aCC_Head.UpdateDate = DateTime.Now; aCC_Head.RowStatusID = 1; HeadID = ACC_HeadManager.InsertACC_Head(aCC_Head); //add in the head user ACC_HeadUser aCC_HeadUser = new ACC_HeadUser(); // aCC_HeadUser.HeadUserID= int.Parse(ddlHeadUserID.SelectedValue); aCC_HeadUser.HeadUserName = ""; aCC_HeadUser.HeadID = HeadID; aCC_HeadUser.UserID = UserID; aCC_HeadUser.UserTypeID = int.Parse(ddlUserTypeIDMoney.SelectedValue); aCC_HeadUser.AddedBy = Profile.card_id; aCC_HeadUser.AddedDate = DateTime.Now; aCC_HeadUser.UpdatedBy = Profile.card_id; aCC_HeadUser.UpdateDate = DateTime.Now; aCC_HeadUser.RowStatusID = 1; ACC_HeadUserManager.InsertACC_HeadUser(aCC_HeadUser); } else { HeadID = int.Parse(dsHeadUser.Tables[0].Rows[0]["HeadID"].ToString()); headNameMoney = dsHeadUser.Tables[0].Rows[0]["HeadName"].ToString(); } hfHeadIDMoney.Value = HeadID.ToString(); lblHeadNameMoney.Text = headNameMoney; }
public static int InsertACC_Head(ACC_Head aCC_Head) { SqlACC_HeadProvider sqlACC_HeadProvider = new SqlACC_HeadProvider(); return sqlACC_HeadProvider.InsertACC_Head(aCC_Head); }
public static bool UpdateACC_Head(ACC_Head aCC_Head) { SqlACC_HeadProvider sqlACC_HeadProvider = new SqlACC_HeadProvider(); return sqlACC_HeadProvider.UpdateACC_Head(aCC_Head); }
private void getHead(bool IsNewCompany) { string UserID = ""; string UserName = ""; if (ddlAccountingUser.Visible != false) { UserID = ddlAccountingUser.SelectedValue; if (ddlUserTypeID.SelectedValue == "2" || ddlUserTypeID.SelectedValue == "3") { UserName = ddlAccountingUser.SelectedItem.Text; } else { UserName = "******" + ddlAccountingUser.SelectedValue + ") " + ddlAccountingUser.SelectedItem.Text; } } else { STD_Student student=STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text); UserID = student.StudentID; UserName = "******" + txtStudentCode.Text + ") " + student.StudentName; } if (IsNewCompany && txtNewCompany.Text!="") { ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser(); // aCC_AccountingUser.AccountingUserID= int.Parse(ddlAccountingUserID.SelectedValue); aCC_AccountingUser.AccountingUserName = txtNewCompany.Text; UserName = txtNewCompany.Text; aCC_AccountingUser.UserTypeID = int.Parse(ddlUserTypeID.SelectedValue); aCC_AccountingUser.AddedBy = Profile.card_id; aCC_AccountingUser.AddedDate = DateTime.Now; aCC_AccountingUser.UpdatedBy = Profile.card_id; aCC_AccountingUser.UpdateDate = DateTime.Now; aCC_AccountingUser.RowStatusID = 1; UserID = ACC_AccountingUserManager.InsertACC_AccountingUser(aCC_AccountingUser).ToString(); } int HeadID = 0; string headName = ""; if (ddlAccountID.SelectedValue != "0") { DataSet dsHeadUser = ACC_HeadUserManager.GetACC_UserByUserIDnUserTypeIDnAccountID(UserID, int.Parse(ddlUserTypeID.SelectedValue), int.Parse(ddlAccountID.SelectedValue)); if (dsHeadUser.Tables[0].Rows.Count == 0) { //need to create the dead for this user ACC_Head aCC_Head = new ACC_Head(); // aCC_Head.HeadID= int.Parse(ddlHeadID.SelectedValue); aCC_Head.HeadName = ddlAccountID.SelectedItem.Text+" " + UserName; headName = aCC_Head.HeadName; aCC_Head.HeadCode = ""; //code need to generate automatically aCC_Head.AccountID = int.Parse(ddlAccountID.SelectedValue); aCC_Head.AddedBy = Profile.card_id; aCC_Head.AddedDate = DateTime.Now; aCC_Head.UpdatedBy = Profile.card_id; aCC_Head.UpdateDate = DateTime.Now; aCC_Head.RowStatusID = 1; HeadID = ACC_HeadManager.InsertACC_Head(aCC_Head); //add in the head user ACC_HeadUser aCC_HeadUser = new ACC_HeadUser(); // aCC_HeadUser.HeadUserID= int.Parse(ddlHeadUserID.SelectedValue); aCC_HeadUser.HeadUserName = ""; aCC_HeadUser.HeadID = HeadID; aCC_HeadUser.UserID = UserID; aCC_HeadUser.UserTypeID = int.Parse(ddlUserTypeID.SelectedValue); aCC_HeadUser.AddedBy = Profile.card_id; aCC_HeadUser.AddedDate = DateTime.Now; aCC_HeadUser.UpdatedBy = Profile.card_id; aCC_HeadUser.UpdateDate = DateTime.Now; aCC_HeadUser.RowStatusID = 1; ACC_HeadUserManager.InsertACC_HeadUser(aCC_HeadUser); } else { HeadID = int.Parse(dsHeadUser.Tables[0].Rows[0]["HeadID"].ToString()); headName = dsHeadUser.Tables[0].Rows[0]["HeadName"].ToString(); } } else { return; } hfHeadID.Value = HeadID.ToString(); lblHeadName.Text = headName; }
private void showACC_HeadData() { ACC_Head aCC_Head = new ACC_Head (); aCC_Head = ACC_HeadManager.GetACC_HeadByHeadID(Int32.Parse(Request.QueryString["ID"])); txtHeadName.Text =aCC_Head.HeadName.ToString(); txtHeadCode.Text =aCC_Head.HeadCode.ToString(); ddlAccountID.SelectedValue =aCC_Head.AccountID.ToString(); ddlRowStatusID.SelectedValue =aCC_Head.RowStatusID.ToString(); }
public ACC_Head GetACC_HeadFromReader(IDataReader reader) { try { ACC_Head aCC_Head = new ACC_Head ( DataAccessObject.IsNULL<int>(reader["HeadID"]), DataAccessObject.IsNULL<string>(reader["HeadName"]), DataAccessObject.IsNULL<string>(reader["HeadCode"]), DataAccessObject.IsNULL<int>(reader["AccountID"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"]), DataAccessObject.IsNULL<int>(reader["RowStatusID"]) ); return aCC_Head; } catch(Exception ex) { return null; } }
public bool UpdateACC_Head(ACC_Head aCC_Head) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateACC_Head", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@HeadID", SqlDbType.Int).Value = aCC_Head.HeadID; cmd.Parameters.Add("@HeadName", SqlDbType.NVarChar).Value = aCC_Head.HeadName; cmd.Parameters.Add("@HeadCode", SqlDbType.NVarChar).Value = aCC_Head.HeadCode; cmd.Parameters.Add("@AccountID", SqlDbType.Int).Value = aCC_Head.AccountID; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = aCC_Head.UpdatedBy; cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = aCC_Head.UpdateDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = aCC_Head.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }