Пример #1
0
 public static ACC_AccountingUser GetACC_UserTypeByUserTypeID(int UserTypeID)
 {
     ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser();
     SqlACC_AccountingUserProvider sqlACC_AccountingUserProvider = new SqlACC_AccountingUserProvider();
     aCC_AccountingUser = sqlACC_AccountingUserProvider.GetACC_AccountingUserByUserTypeID(UserTypeID);
     return aCC_AccountingUser;
 }
Пример #2
0
 public static ACC_AccountingUser GetACC_RowStatusByRowStatusID(int RowStatusID)
 {
     ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser();
     SqlACC_AccountingUserProvider sqlACC_AccountingUserProvider = new SqlACC_AccountingUserProvider();
     aCC_AccountingUser = sqlACC_AccountingUserProvider.GetACC_AccountingUserByRowStatusID(RowStatusID);
     return aCC_AccountingUser;
 }
Пример #3
0
 public static ACC_AccountingUser GetACC_AccountingUserByAccountingUserID(int AccountingUserID)
 {
     ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser();
     SqlACC_AccountingUserProvider sqlACC_AccountingUserProvider = new SqlACC_AccountingUserProvider();
     aCC_AccountingUser = sqlACC_AccountingUserProvider.GetACC_AccountingUserByAccountingUserID(AccountingUserID);
     return aCC_AccountingUser;
 }
Пример #4
0
 private void showACC_AccountingUserData()
 {
     ACC_AccountingUser aCC_AccountingUser  = new ACC_AccountingUser ();
      	aCC_AccountingUser = ACC_AccountingUserManager.GetACC_AccountingUserByAccountingUserID(Int32.Parse(Request.QueryString["ID"]));
      	txtAccountingUserName.Text =aCC_AccountingUser.AccountingUserName.ToString();
      	ddlUserTypeID.SelectedValue  =aCC_AccountingUser.UserTypeID.ToString();
      	ddlRowStatusID.SelectedValue  =aCC_AccountingUser.RowStatusID.ToString();
 }
Пример #5
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser ();
     aCC_AccountingUser.AccountingUserID=  int.Parse(Request.QueryString["ID"].ToString());
     aCC_AccountingUser.AccountingUserName=  txtAccountingUserName.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=  int.Parse(ddlRowStatusID.SelectedValue);
     bool  resutl =ACC_AccountingUserManager.UpdateACC_AccountingUser(aCC_AccountingUser);
     Response.Redirect("AdminDisplayACC_AccountingUser.aspx");
 }
Пример #6
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     ACC_AccountingUser aCC_AccountingUser = new ACC_AccountingUser ();
     //	aCC_AccountingUser.AccountingUserID=  int.Parse(ddlAccountingUserID.SelectedValue);
     aCC_AccountingUser.AccountingUserName=  txtAccountingUserName.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=  int.Parse(ddlRowStatusID.SelectedValue);
     int resutl =ACC_AccountingUserManager.InsertACC_AccountingUser(aCC_AccountingUser);
     Response.Redirect("AdminDisplayACC_AccountingUser.aspx");
 }
Пример #7
0
    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;
    }
Пример #8
0
    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;
    }
Пример #9
0
 public static bool UpdateACC_AccountingUser(ACC_AccountingUser aCC_AccountingUser)
 {
     SqlACC_AccountingUserProvider sqlACC_AccountingUserProvider = new SqlACC_AccountingUserProvider();
     return sqlACC_AccountingUserProvider.UpdateACC_AccountingUser(aCC_AccountingUser);
 }
Пример #10
0
 public static int InsertACC_AccountingUser(ACC_AccountingUser aCC_AccountingUser)
 {
     SqlACC_AccountingUserProvider sqlACC_AccountingUserProvider = new SqlACC_AccountingUserProvider();
     return sqlACC_AccountingUserProvider.InsertACC_AccountingUser(aCC_AccountingUser);
 }