示例#1
0
        public PartyEntry(int AccountHeadId)
        {
            InitializeComponent();
            Partyid = AccountHeadId;
            AccountHeadModel table = new AccountHeadModel();

            table.Action        = "fetchbyid";
            table.AccountHeadId = Partyid;
            DataSet ds = table.AccountHeadOperation();

            if (ds.Tables[0].Rows.Count > 0)
            {
                txt_PartyName.Text = ds.Tables[0].Rows[0]["Name"].ToString();
                txt_Address.Text   = ds.Tables[0].Rows[0]["Address"].ToString();
                txt_PhoneNo.Text   = ds.Tables[0].Rows[0]["ContactNo1"].ToString();

                txt_EmailId.Text = ds.Tables[0].Rows[0]["Emailid"].ToString();
                txt_Gstinno.Text = ds.Tables[0].Rows[0]["GstInNo"].ToString();
                if (ds.Tables[0].Rows[0]["AccountGroupId"].ToString() == "21")
                {
                    rb_PurchaseParty.Checked = true;
                }
                else
                {
                    rb_SaleParty.Checked = true;
                }
                btn_Save.Text          = "Update";
                btn_SaveAddNew.Enabled = false;
                lbl_AddParty.Text      = "Update Party";
                LoadDetails();
            }
        }
示例#2
0
        public void Auto()
        {
            AccountHeadModel accountHeadModel = new AccountHeadModel();

            accountHeadModel.Action          = "Search";
            accountHeadModel.AccountHeadName = txt_fromAccnt.Text;
            accountHeadModel.AccountHeadName = txt_toAccnt.Text;

            DataSet dt = accountHeadModel.AccountHeadOperation();

            if (dt.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
                {
                    col.Add(dt.Tables[0].Rows[i]["AccountHeadName"].ToString());
                }
            }


            txt_fromAccnt.AutoCompleteMode         = AutoCompleteMode.Suggest;
            txt_fromAccnt.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txt_fromAccnt.AutoCompleteCustomSource = col;

            txt_toAccnt.AutoCompleteMode = AutoCompleteMode.Suggest;

            txt_toAccnt.AutoCompleteSource = AutoCompleteSource.CustomSource;

            txt_toAccnt.AutoCompleteCustomSource = col;
        }
示例#3
0
        private DataTable GetAll()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("AccountHeadId", typeof(string));
            dt.Columns.Add("AccountGroupName", typeof(string));
            dt.Columns.Add("BankName", typeof(string));
            dt.Columns.Add("BankIFSCCode", typeof(string));
            dt.Columns.Add("BankAccountNo", typeof(string));
            dt.Columns.Add("BankBranchName", typeof(string));
            dt.Columns.Add("BankAccountHolderName", typeof(string));
            AccountHeadModel bankDetailsModel = new AccountHeadModel();

            bankDetailsModel.Action = "fetch_bankaccounts_bankcc_bankod";
            DataSet ds = bankDetailsModel.AccountHeadOperation();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                dt.Rows.Add(
                    ds.Tables[0].Rows[i]["AccountHeadId"].ToString(),
                    ds.Tables[0].Rows[i]["AccountGroupName"].ToString(),
                    ds.Tables[0].Rows[i]["BankName"].ToString(),
                    ds.Tables[0].Rows[i]["BankIFSCCode"].ToString(),
                    ds.Tables[0].Rows[i]["BankAccountNo"].ToString(),
                    ds.Tables[0].Rows[i]["BankBranchName"].ToString(),
                    ds.Tables[0].Rows[i]["BankAccountHolderName"].ToString()
                    );
            }
            return(dt);
        }
示例#4
0
        private bool Save()
        {
            AccountHeadModel bankDetailsModel = new AccountHeadModel();

            if (btn_Save.Text == "Update")
            {
                bankDetailsModel.Action        = "update";
                bankDetailsModel.AccountHeadId = PAccountHeadId;
            }
            else
            {
                bankDetailsModel.Action = "insert";
            }

            bankDetailsModel.BankName = txt_BankName.Text;
            if (ddl_accountGrpId.SelectedItem.ToString() == "Bank Account")
            {
                bankDetailsModel.AccountGroupId = 1;
            }
            else if (ddl_accountGrpId.SelectedItem.ToString() == "Bank CC A/C")
            {
                bankDetailsModel.AccountGroupId = 2;
            }
            else if (ddl_accountGrpId.SelectedItem.ToString() == "Bank OD A/C")
            {
                bankDetailsModel.AccountGroupId = 3;
            }

            bankDetailsModel.AccountHeadName       = txt_accountHeadName.Text;
            bankDetailsModel.BankName              = txt_BankName.Text;
            bankDetailsModel.BankIFSCCode          = txt_bankIFSCcode.Text;
            bankDetailsModel.BankBranchName        = txt_bankBranchName.Text;
            bankDetailsModel.BankAccountNo         = txt_bankAccountNo.Text;
            bankDetailsModel.BankAccountHolderName = txt_accountHolderName.Text;

            DataSet ds = bankDetailsModel.AccountHeadOperation();

            if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Record Submitted Successfully")
            {
                MessageBox.Show("Record Submitted Successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(true);
            }
            else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Updated Successfully")
            {
                MessageBox.Show("Updated Successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(true);
            }
            else
            {
                MessageBox.Show("Please try again Later", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return(false);
            }
        }
示例#5
0
        public void Auto()
        {
            AccountHeadModel accountHeadModel = new AccountHeadModel();

            accountHeadModel.Action          = "Search";
            accountHeadModel.AccountHeadName = txt_accountHeadName.Text;
            DataSet dt = accountHeadModel.AccountHeadOperation();

            if (dt.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
                {
                    col.Add(dt.Tables[0].Rows[i]["AccountHeadName"].ToString());
                }
            }
            //else
            //{
            //    MessageBox.Show("Name not Found.");
            //}
            txt_accountHeadName.AutoCompleteMode         = AutoCompleteMode.Suggest;
            txt_accountHeadName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txt_accountHeadName.AutoCompleteCustomSource = col;
            //fetch item name
            ItemMasterModel item = new ItemMasterModel();

            item.Action   = "Search";
            item.ItemName = txt_itemName.Text;
            DataSet dt1 = item.ItemOperation();

            if (dt1.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dt1.Tables[0].Rows.Count; i++)
                {
                    col1.Add(dt1.Tables[0].Rows[i]["ItemName"].ToString());
                }
            }
            else
            {
                MessageBox.Show("Name not Found.");
            }
            txt_itemName.AutoCompleteMode         = AutoCompleteMode.Suggest;
            txt_itemName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txt_itemName.AutoCompleteCustomSource = col1;
        }
示例#6
0
        private DataTable GetAll()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("AccountHeadId", typeof(string));
            dt.Columns.Add("accountheadname", typeof(string));
            dt.Columns.Add("AccountGroup", typeof(string));
            dt.Columns.Add("partyname", typeof(string));
            dt.Columns.Add("gstinno", typeof(string));
            dt.Columns.Add("state", typeof(string));
            dt.Columns.Add("phoneno", typeof(string));
            dt.Columns.Add("emilid", typeof(string));
            dt.Columns.Add("address", typeof(string));
            dt.Columns.Add("openingbalance", typeof(string));
            dt.Columns.Add("openingbalancetype", typeof(string));
            AccountHeadModel account = new AccountHeadModel();

            account.Action = "fetch";
            DataSet ds = account.AccountHeadOperation();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                dt.Rows.Add(
                    ds.Tables[0].Rows[i]["AccountHeadId"].ToString(),
                    ds.Tables[0].Rows[i]["AccountHeadName"].ToString(),
                    ds.Tables[0].Rows[i]["AccountGroupName"].ToString(),
                    ds.Tables[0].Rows[i]["Name"].ToString(),
                    ds.Tables[0].Rows[i]["GstinNo"].ToString(),
                    ds.Tables[0].Rows[i]["State"].ToString(),
                    ds.Tables[0].Rows[i]["ContactNo1"].ToString(),
                    ds.Tables[0].Rows[i]["EmailId"].ToString(),
                    ds.Tables[0].Rows[i]["Address"].ToString(),
                    ds.Tables[0].Rows[i]["OpeningBalance"].ToString(),
                    ds.Tables[0].Rows[i]["OpeningBalanceType"].ToString()
                    );
            }
            return(dt);
        }
示例#7
0
        public BankDetailsEntry(int AccountHeadId)
        {
            InitializeComponent();
            PAccountHeadId = AccountHeadId;
            AccountHeadModel bankDetailsModel = new AccountHeadModel();

            bankDetailsModel.Action        = "fetchbyid";
            bankDetailsModel.AccountHeadId = PAccountHeadId;
            DataSet ds = bankDetailsModel.AccountHeadOperation();

            if (ds.Tables[0].Rows.Count > 0)
            {
                txt_accountHeadName.Text      = ds.Tables[0].Rows[0]["AccountHeadName"].ToString();
                txt_BankName.Text             = ds.Tables[0].Rows[0]["BankName"].ToString();
                txt_bankIFSCcode.Text         = ds.Tables[0].Rows[0]["BankIFSCCode"].ToString();
                txt_bankBranchName.Text       = ds.Tables[0].Rows[0]["BankBranchName"].ToString();
                txt_bankAccountNo.Text        = ds.Tables[0].Rows[0]["BankAccountNo"].ToString();
                txt_accountHolderName.Text    = ds.Tables[0].Rows[0]["BankAccountHolderName"].ToString();
                ddl_accountGrpId.SelectedItem = ds.Tables[0].Rows[0]["AccountGroupId"].ToString();
                btn_AddSaveNew.Enabled        = false;
                btn_Save.Text = "Update";
            }
        }
示例#8
0
        private bool Save()
        {
            if (txt_PartyName.Text != "")
            {
                double amount = 0;
                try
                {
                    amount = double.Parse(txt_CurrentBalance.Text);
                }
                catch
                {
                }
                if (rb_PurchaseParty.Checked == true)
                {
                    AccountHeadModel account = new AccountHeadModel();


                    if (btn_Save.Text == "Update")
                    {
                        account.Action        = "update";
                        account.AccountHeadId = Partyid;
                    }
                    else
                    {
                        account.Action = "insert";
                    }

                    account.AccountHeadName    = txt_PartyName.Text;
                    account.AccountGroupId     = 21;
                    account.Name               = txt_PartyName.Text;
                    account.GstInNo            = txt_Gstinno.Text;
                    account.State              = ddl_State.SelectedItem.ToString();
                    account.ContactNo1         = txt_PhoneNo.Text;
                    account.EmailId            = txt_EmailId.Text;
                    account.Address            = txt_Address.Text;
                    account.OpeningBalance     = amount;
                    account.OpeningBalanceType = ddl_OpeningBalanceType.SelectedItem.ToString();
                    DataSet ds = account.AccountHeadOperation();
                    if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Record Submitted Successfully")
                    {
                        MessageBox.Show("Record Submitted successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(true);
                    }
                    else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Updated Successfully")
                    {
                        MessageBox.Show("Record Updated Successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(true);
                    }


                    else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Duplicate Record")
                    {
                        MessageBox.Show("Record Already Exists!!!Please Try Again With Diffrent Account HeadName", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return(false);
                    }
                    else
                    {
                        MessageBox.Show("Failed to Execute Command!!! Please Try Again Later", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return(false);
                    }
                }
                else if (rb_SaleParty.Checked == true)
                {
                    AccountHeadModel account = new AccountHeadModel();


                    if (btn_Save.Text == "Update")
                    {
                        account.Action        = "update";
                        account.AccountHeadId = Partyid;
                    }
                    else
                    {
                        account.Action = "insert";
                    }
                    account.AccountHeadName    = txt_PartyName.Text;
                    account.AccountGroupId     = 22;
                    account.Name               = txt_PartyName.Text;
                    account.GstInNo            = txt_Gstinno.Text;
                    account.State              = ddl_State.SelectedItem.ToString();
                    account.ContactNo1         = txt_PhoneNo.Text;
                    account.EmailId            = txt_EmailId.Text;
                    account.Address            = txt_Address.Text;
                    account.OpeningBalance     = amount;
                    account.OpeningBalanceType = ddl_OpeningBalanceType.SelectedItem.ToString();
                    DataSet ds = account.AccountHeadOperation();
                    if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Record Submitted Successfully")
                    {
                        MessageBox.Show("Record Submitted successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(true);
                    }
                    else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Updated Successfully")
                    {
                        MessageBox.Show("Record Updated Successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(true);
                    }


                    else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Duplicate Record")
                    {
                        MessageBox.Show("Record Already Exists!!!Please Try Again With Diffrent Account HeadName", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return(false);
                    }
                    else
                    {
                        MessageBox.Show("Failed to Execute Command!!! Please Try Again Later", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return(false);
                    }
                }

                else
                {
                    MessageBox.Show("Please Select Party Type Purchase Party Or Sales Party", "MinifyERP", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
            }
            else
            {
                MessageBox.Show("Please Enter  Party Name", "Minify ERP", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }