예제 #1
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            string code = vad.Text.Trim();

            if (!Validator.IsValidString(code))
            {
                GUIutils.ShowMessage(" Code Is Not Valid");
                return;
            }

            if (!Party.Isexist(code))
            {
                GUIutils.ShowMessage(" Code doesnt Exists");
                return;
            }

            Party.DeleteParty(code);
            vad.Clear();
            desctxt.Clear();
            accodetxt.Clear();
            ad1txt.Clear();
            ad2txt.Clear();
            phtxt.Clear();
            faxtxt.Clear();
            citytxt.Clear();
            detxt.Clear();

            addbtn.Enabled    = true;
            updatebtn.Enabled = false;
        }
예제 #2
0
        private void vendortxt_Leave(object sender, EventArgs e)
        {
            string    ven  = vendortxt.Text;
            bool      flag = false;
            DataTable dt   = Party.ListParty();

            foreach (DataRow dr in dt.Rows)
            {
                if (dr["pname"].ToString().Trim() == ven.Trim())
                {
                    flag = true;
                    return;
                }
            }

            if (flag == false)
            {
                GUIutils.ShowMessage(" vendor doesnt exist ");
                unittxt.Clear();

                return;
            }

            deletebtn.Enabled = true;
            updatebtn.Enabled = true;
        }
예제 #3
0
        private void updatebtn_Click(object sender, EventArgs e)
        {
            string code = codetxt.Text;
            string name = desctxt.Text;


            if (!Validator.IsValidString(code))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }

            if (!Unit.Isexist(code))
            {
                GUIutils.ShowMessage("Account Code Doesn't Exists");
                return;
            }

            if (!Validator.IsValidString(name))
            {
                GUIutils.ShowMessage("Account Name Is Not Valid");
                return;
            }


            Unit.UpdateUnit(code, name);
            codetxt.Clear();
            desctxt.Clear();
        }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string icode = codetxt.Text;
            string idesc = desctxt.Text;

            if (!Validator.IsValidString(icode))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }
            if (icode.Length != 3)
            {
                GUIutils.ShowMessage("Account Code Should be Three Characters");
                return;
            }
            if (Group.Isexist(icode))
            {
                GUIutils.ShowMessage("Account Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(idesc))
            {
                GUIutils.ShowMessage("Account Name Is Not Valid");
                return;
            }


            Group.AddGroup(icode, idesc);
            codetxt.Clear();
            desctxt.Clear();
        }
예제 #5
0
        private void codetxt_Leave(object sender, EventArgs e)
        {
            string icode = codetxt.Text;

            if (!Validator.IsValidString(icode))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }
            if (icode.Length != 3)
            {
                GUIutils.ShowMessage("Account Code Should be Three Characters");
                return;
            }
            if (!Group.Isexist(icode))
            {
                //GUIutils.ShowMessage("Account Code doesnt  Exists");
                return;
            }

            DataTable dt = Group.GetGroup(icode);
            DataRow   dr = dt.Rows[0];


            string desc = dr["gname"] as string;

            desctxt.Text = desc.ToString();

            deletebtn.Enabled = true;
            updatebtn.Enabled = false;
        }
예제 #6
0
        private void updatebtn_Click(object sender, EventArgs e)
        {
            string code = codetxt.Text;
            string name = desctxt.Text;


            if (!Validator.IsValidString(code))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }
            if (code.Length != 3)
            {
                GUIutils.ShowMessage("Account Code Should be Three Characters");
                return;
            }
            if (!Group.Isexist(code))
            {
                GUIutils.ShowMessage("Account Code Doesn't Exists");
                return;
            }

            if (!Validator.IsValidString(name))
            {
                GUIutils.ShowMessage("Account Name Is Not Valid");
                return;
            }


            Group.UpdateGroup(code, name);
            codetxt.Clear();
            desctxt.Clear();
        }
예제 #7
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            string ucode = codetxt.Text.ToLower();
            string udesc = desctxt.Text;

            if (!Validator.IsValidString(ucode))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }

            if (Unit.Isexist(ucode))
            {
                GUIutils.ShowMessage("Account Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(udesc))
            {
                GUIutils.ShowMessage("Account Name Is Not Valid");
                return;
            }


            Unit.AddUnit(ucode, udesc);
            codetxt.Clear();
            desctxt.Clear();
        }
예제 #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataTable dts = Unit.ListUnit();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Unit.GetUnit(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            codetxt.Text = dr["ucode"].ToString();
            desctxt.Text = dr["uname"].ToString();

            deletebtn.Enabled = true;
            addbtn.Enabled    = false;
        }
예제 #9
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            string icode = codetxt.Text;
            string idesc = desctxt.Text;
            string grp   = grouptxt.Text;
            string vend  = vendortxt.Text;
            string unit  = unittxt.Text;


            if (!Validator.IsValidString(icode))
            {
                GUIutils.ShowMessage(" COde Is Not Valid");
                return;
            }

            if (Items.Isexist(icode))
            {
                GUIutils.ShowMessage(" Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(idesc))
            {
                GUIutils.ShowMessage(" Name Is Not Valid");
                return;
            }

            if (!Validator.IsValidNumber(ratetxt.Text))
            {
                GUIutils.ShowMessage("Rate should be Numeric Value");
                return;
            }

            if (!Validator.IsValidNumber(qntytxt.Text))
            {
                GUIutils.ShowMessage("Quantity should be Numeric Value");
                return;
            }

            if (!Validator.IsValidNumber(svaltxt.Text))
            {
                GUIutils.ShowMessage("StockValue  should be Numeric Value");
                return;
            }

            decimal rate = Convert.ToDecimal(ratetxt.Text);
            decimal qty  = Convert.ToDecimal(qntytxt.Text);
            decimal val  = Convert.ToDecimal(svaltxt.Text);


            Items.AddItem(icode, idesc, gcode, ucode, rate, qty, val, pcode);
            codetxt.Clear();
            desctxt.Clear();
            grouptxt.Clear();
            unittxt.Clear();
            qntytxt.Clear();
            svaltxt.Clear();
            vendortxt.Clear();
            ratetxt.Clear();
        }
예제 #10
0
        private void codetxt_Leave(object sender, EventArgs e)
        {
            string ucode = codetxt.Text;

            if (!Validator.IsValidString(ucode))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }

            if (!Unit.Isexist(ucode))
            {
                //GUIutils.ShowMessage("Account Code doesnt  Exists");
                return;
            }

            DataTable dt = Unit.GetUnit(ucode);
            DataRow   dr = dt.Rows[0];


            string desc = dr["uname"] as string;

            desctxt.Text = desc.ToString();

            deletebtn.Enabled = true;
            updatebtn.Enabled = false;
        }
예제 #11
0
        private void popupbtn_Click(object sender, EventArgs e)
        {
            DataTable dt  = SubGroup.ViewSubGroup();
            ArrayList arr = GetSelectedItem.ItemSelect(
                dt, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }


            string    tacc_code = arr[0].ToString();
            DataTable dts       = SubGroup.GetSubGroup(tacc_code);

            if (dts.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Account code doesnt exist");
                return;
            }

            DataRow dr = dts.Rows[0];

            this.AccCodetxt.Text = dr["S_CODE"].ToString();
            this.AccDestxt.Text  = dr["S_DESC"].ToString();
            string    sname  = dr["S_TYPE"].ToString();
            string    s_type = "";
            DataTable dtt    = Group.ListGroup();

            foreach (DataRow rw in dtt.Rows)
            {
                if (sname == rw[0].ToString())
                {
                    s_type = rw[1].ToString().ToUpper();
                    break;
                }
            }
            this.AccTypeCombo.SelectedItem = s_type;
            this.AccTypeCombo.Refresh();

            /*if (s_type == "A")
             * {
             *  this.AccTypeCombo.SelectedItem = "ASSET";
             * }
             * else if (s_type == "L")
             * {
             *  this.AccTypeCombo.SelectedItem = "LIABILITY";
             * }
             * else if (s_type == "E")
             * {
             *  this.AccTypeCombo.SelectedItem = "EXPENSE";
             * }
             * else if (s_type == "I")
             * {
             *  this.AccTypeCombo.SelectedItem = "INCOME";
             * }*/
            this.OPBALTXT.Text          = dr["S_OPBAL"].ToString();
            this.DRCRCombo.SelectedItem = dr["S_DRCR"].ToString();
        }
예제 #12
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            string acc_code  = AccTypeCodetxt.Text;
            string acc_name  = AccTypeNametxt.Text.ToUpper();
            string acc_class = "";
            string curbal    = CBALtxt.Text;

            if (!Validator.IsValidString(acc_code))
            {
                GUIutils.ShowMessage("Account COde Is Not Valid");
                return;
            }
            if (acc_code.Length != 2)
            {
                GUIutils.ShowMessage("Account Code Should be Two Characters");
                return;
            }
            if (Group.Isexist(acc_code))
            {
                GUIutils.ShowMessage("Account Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(acc_name))
            {
                GUIutils.ShowMessage("Account Name Is Not Valid");
                return;
            }

            if (AccClassCombo.SelectedIndex == -1)
            {
                GUIutils.ShowMessage("select An Account Class");
                return;
            }

            acc_class = AccClassCombo.SelectedItem.ToString().Trim().ToUpper();

            if (!(acc_class == "ASSET" || acc_class == "LIABILITY" ||
                  acc_class == "EXPENSE" || acc_class == "INCOME"))
            {
                GUIutils.ShowMessage("Account class should be selected");
                return;
            }

            acc_class = acc_class.Substring(0, 1);

            if (!Validator.IsValidNumber(curbal))
            {
                GUIutils.ShowMessage("Current Balance should be Numeric Value");
                return;
            }

            decimal crr = Convert.ToDecimal(curbal);

            Group.AddGroup(acc_code, acc_name, acc_class, crr);
        }
예제 #13
0
        private void Showbtn_Click(object sender, EventArgs e)
        {
            string tacc_code = acctxt.Text;

            if (!SubGroup.IsSubGroup(tacc_code))
            {
                GUIutils.ShowMessage("Account does not exist");
                return;
            }

            DataTable dt = LedgerBalance.LedgerTable(tacc_code);

            Report2(dt);
        }
예제 #14
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            string acc_code = AccTypeCodetxt.Text;

            DataTable dt = Group.GetGroup(acc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Account Type Code Doesn't Exist");
                return;
            }

            Group.DeleteGroup(acc_code);
        }
예제 #15
0
        private void PopupBtn_Click(object sender, EventArgs e)
        {
            DataTable dts = Group.ListGroup();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Group.GetGroup(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Account Type code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            this.AccTypeCodetxt.Text = dr["A_CODE"].ToString();
            this.AccTypeNametxt.Text = dr["A_DESC"].ToString();
            string t_type = dr["A_TYPE"].ToString();

            if (t_type == "A")
            {
                this.AccClassCombo.SelectedItem = "ASSET";
            }
            else if (t_type == "L")
            {
                this.AccClassCombo.SelectedItem = "LIABILITY";
            }
            else if (t_type == "E")
            {
                this.AccClassCombo.SelectedItem = "EXPENSE";
            }
            else if (t_type == "I")
            {
                this.AccClassCombo.SelectedItem = "INCOME";
            }

            this.CBALtxt.Text = dr["A_CURRB"].ToString();

            this.AddBtn.Enabled    = false;
            this.deletebtn.Enabled = true;
            this.UPdatebtn.Enabled = false;
        }
예제 #16
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            string code = codetxt.Text;

            DataTable dt = Unit.GetUnit(code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Account Type Code Doesn't Exist");
                return;
            }

            Unit.DeleteUnit(code);
            codetxt.Clear();
            desctxt.Clear();
        }
예제 #17
0
        private void codetxt_Leave(object sender, EventArgs e)
        {
            string code = vad.Text.Trim();

            if (Party.Isexist(code))
            {
                GUIutils.ShowMessage("Code  exist");
            }
            else
            {
                desctxt.Clear();
                accodetxt.Clear();
                ad1txt.Clear();
                ad2txt.Clear();
                phtxt.Clear();
                faxtxt.Clear();
                citytxt.Clear();
                detxt.Clear();
            }

            DataTable dt = Party.GetParty(code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Party code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            //codetxt.Text = dr["pcode"].ToString().Trim();
            desctxt.Text   = dr["pname"].ToString().Trim();
            accodetxt.Text = dr["p_acccode"].ToString().Trim();
            ad1txt.Text    = dr["address1"].ToString().Trim();
            ad2txt.Text    = dr["address2"].ToString().Trim();
            phtxt.Text     = dr["phone"].ToString().Trim();
            faxtxt.Text    = dr["fax"].ToString().Trim();
            citytxt.Text   = dr["city"].ToString().Trim();
            detxt.Text     = dr["otherdetail"].ToString().Trim();


            deletebtn.Enabled = true;
            addbtn.Enabled    = true;
            updatebtn.Enabled = false;
        }
예제 #18
0
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            string sub_code = AccCodetxt.Text;

            if (!Validator.IsValidString(sub_code))
            {
                GUIutils.ShowMessage("Enter the valid Account code");
                return;
            }

            if (!SubGroup.IsSubGroup(sub_code))
            {
                GUIutils.ShowMessage("Account code doesn't exist");
                return;
            }

            SubGroup.DeleteSubGroup(sub_code);
        }
예제 #19
0
        private void grouptxt_Leave(object sender, EventArgs e)
        {
            string    gp   = grouptxt.Text;
            bool      flag = false;
            DataTable dt   = Group.ListGroup();

            foreach (DataRow dr in dt.Rows)
            {
                if (dr["gname"].ToString().Trim() == gp.Trim())
                {
                    flag = true;
                    return;
                }
            }

            if (flag == false)
            {
                GUIutils.ShowMessage("Group doesnt exist");
                grouptxt.Clear();
                return;
            }
        }
예제 #20
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            string code = codetxt.Text;

            DataTable dt = Items.GetItem(code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Item Code Doesn't Exist");
                return;
            }

            Items.DeleteItem(code);
            codetxt.Clear();
            desctxt.Clear();
            grouptxt.Clear();
            unittxt.Clear();
            qntytxt.Clear();
            svaltxt.Clear();
            vendortxt.Clear();
            ratetxt.Clear();
        }
예제 #21
0
        private void unittxt_Leave(object sender, EventArgs e)
        {
            string    unit = unittxt.Text;
            bool      flag = false;
            DataTable dt   = Unit.ListUnit();

            foreach (DataRow dr in dt.Rows)
            {
                if (dr["uname"].ToString().Trim() == unit.Trim())
                {
                    flag = true;
                    return;
                }
            }

            if (flag == false)
            {
                GUIutils.ShowMessage(" Unit doesnt exist ");
                unittxt.Clear();

                return;
            }
        }
예제 #22
0
        private void button3_Click(object sender, EventArgs e)
        {
            DataTable dts = Party.ListParty();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Party.GetParty(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Account Type code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            Crtxt.Text = dr["pname"].ToString();
            pcode      = dr["pcode"].ToString();
        }
예제 #23
0
        private void ucbtn_Click(object sender, EventArgs e)
        {
            DataTable dts = Unit.ListUnit();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Unit.GetUnit(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Unit code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            ucode        = dr["ucode"].ToString();
            unittxt.Text = dr["uname"].ToString();
        }
예제 #24
0
        private void gcbtn_Click(object sender, EventArgs e)
        {
            DataTable dts = Group.ListGroup();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Group.GetGroup(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            gcode         = dr["gcode"].ToString();
            grouptxt.Text = dr["gname"].ToString();
        }
예제 #25
0
        private void clickbtn_Click(object sender, EventArgs e)
        {
            DataTable dts = Party.ListParty();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString().Trim();
            DataTable dt        = Party.GetParty(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Party code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            vad.Text       = dr["pcode"].ToString().Trim();
            desctxt.Text   = dr["pname"].ToString().Trim();
            accodetxt.Text = dr["p_acccode"].ToString().Trim();
            ad1txt.Text    = dr["address1"].ToString().Trim();
            ad2txt.Text    = dr["address2"].ToString().Trim();
            phtxt.Text     = dr["phone"].ToString().Trim();
            faxtxt.Text    = dr["fax"].ToString().Trim();
            citytxt.Text   = dr["city"].ToString().Trim();
            detxt.Text     = dr["otherdetail"].ToString().Trim();


            deletebtn.Enabled = true;
            addbtn.Enabled    = false;
            updatebtn.Enabled = false;
        }
예제 #26
0
        private void codetxt_Leave(object sender, EventArgs e)
        {
            string icode = codetxt.Text;

            if (!Validator.IsValidString(icode))
            {
                GUIutils.ShowMessage("Item COde Is Not Valid");
                return;
            }

            if (!Items.Isexist(icode))
            {
                //GUIutils.ShowMessage("Account Code doesnt  Exists");
                return;
            }

            DataTable dt = Items.GetItem(icode);
            DataRow   dr = dt.Rows[0];


            string  desc = dr["itemdesc"] as string;
            string  grp  = dr["itemgp"] as string;
            string  unit = dr["unit"] as string;
            decimal rate = Convert.ToDecimal(dr["rate"] as object);
            decimal qty  = Convert.ToDecimal(dr["qty"] as object);
            decimal val  = Convert.ToDecimal(dr["stockvalue"] as object);
            string  vend = dr["vendor"] as string;

            DataTable dt1 = Group.GetGroup(grp);

            if (dt1.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr1 = dt1.Rows[0];


            grouptxt.Text = dr1["gname"].ToString();

            DataTable dt2 = Unit.GetUnit(unit);

            if (dt2.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr2 = dt2.Rows[0];

            unittxt.Text = dr2["uname"].ToString();


            DataTable dt3 = Party.GetParty(vend);

            if (dt3.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr3 = dt3.Rows[0];

            vendortxt.Text = dr3["pname"].ToString();

            desctxt.Text = desc.ToString();

            qntytxt.Text   = qty.ToString();
            svaltxt.Text   = val.ToString();
            vendortxt.Text = vend.ToString();
            ratetxt.Text   = rate.ToString();

            desctxt.Clear();
            grouptxt.Clear();
            unittxt.Clear();
            qntytxt.Clear();
            svaltxt.Clear();
            vendortxt.Clear();
            ratetxt.Clear();

            deletebtn.Enabled = true;
            updatebtn.Enabled = true;
        }
예제 #27
0
        private void addBtn_Click(object sender, EventArgs e)
        {
            string sub_code = AccCodetxt.Text;
            string sub_desc = AccDestxt.Text.ToUpper();
            string s_type   = "";
            string opbal    = OPBALTXT.Text;
            string s_drcr   = "";
            string sname    = "";
            string stype    = "";

            if (!Validator.IsValidString(sub_code))
            {
                GUIutils.ShowMessage("Account code is not valid");
                return;
            }

            if (sub_code.Length != 5)
            {
                GUIutils.ShowMessage("Account code should be five characters");
                return;
            }

            if (SubGroup.IsSubGroup(sub_code))
            {
                GUIutils.ShowMessage("Account Code already exist");
                return;
            }

            if (!Validator.IsValidString(sub_desc))
            {
                GUIutils.ShowMessage("Account description is not valid");
            }

            if (AccTypeCombo.SelectedIndex == -1)
            {
                GUIutils.ShowMessage("Select an account class");
                return;
            }

            sname = AccTypeCombo.SelectedItem.ToString().ToUpper();
            DataTable dt = Group.ListGroup();

            foreach (DataRow r in dt.Rows)
            {
                if (sname == r[1].ToString().ToUpper())
                {
                    s_type = r[0].ToString();
                    break;
                }
            }


            /* if( !(s_type == "ASSET" || s_type == "LIABILITY" ||
             *   s_type == "EXPENSE" || s_type == "INCOME"))
             * {
             *   GUIutils.ShowMessage("Account class should be selected");
             *   return;
             * }*/

            // s_type = s_type.Substring(0, 1);

            if (!Validator.IsValidNumber(opbal))
            {
                GUIutils.ShowMessage("Opening balance should be numeric");
                return;
            }

            decimal s_opbal = Convert.ToDecimal(opbal);

            if (DRCRCombo.SelectedIndex == -1)
            {
                GUIutils.ShowMessage("Select debit or credit");
                return;
            }

            s_drcr = DRCRCombo.SelectedItem.ToString().ToUpper();

            if (!(s_drcr == "DR" || s_drcr == "CR"))
            {
                GUIutils.ShowMessage("select Debit or Credit");
                return;
            }

            SubGroup.AddSubGroup(sub_code, sub_desc, s_type, s_opbal, s_drcr, "T");
        }
예제 #28
0
        private void ccbtn_Click(object sender, EventArgs e)
        {
            DataTable dts = Items.ListItem();
            ArrayList arr = GetSelectedItem.ItemSelect(dts, new int[] { 1 }, new int[] { 0 });

            if (arr == null)
            {
                return;
            }

            string    tacc_code = arr[0].ToString();
            DataTable dt        = Items.GetItem(tacc_code);

            if (dt.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr = dt.Rows[0];

            codetxt.Text = dr["itemcode"].ToString();
            desctxt.Text = dr["itemdesc"].ToString();
            string grp  = dr["itemgp"] as string;
            string unit = dr["unit"] as string;
            string vend = dr["vendor"] as string;

            DataTable dt1 = Group.GetGroup(grp);

            if (dt1.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr1 = dt1.Rows[0];


            grouptxt.Text = dr1["gname"].ToString();

            DataTable dt2 = Unit.GetUnit(unit);

            if (dt2.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr2 = dt2.Rows[0];

            unittxt.Text = dr2["uname"].ToString();

            DataTable dt3 = Party.GetParty(vend);

            if (dt3.Rows.Count == 0)
            {
                GUIutils.ShowMessage("Group Type code doesnt exist");
                return;
            }

            DataRow dr3 = dt3.Rows[0];

            vendortxt.Text = dr3["pname"].ToString();

            ratetxt.Text = dr["rate"].ToString();
            qntytxt.Text = dr["qty"].ToString();
            svaltxt.Text = dr["stockvalue"].ToString();


            deletebtn.Enabled = true;
            addbtn.Enabled    = false;
            updatebtn.Enabled = false;
        }
예제 #29
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            string code = vad.Text;
            string desc = desctxt.Text;
            string acc  = accodetxt.Text;
            string ad1  = ad1txt.Text;
            string ad2  = ad2txt.Text;
            string ph   = phtxt.Text;
            string fax  = faxtxt.Text;
            string city = citytxt.Text;
            string de   = detxt.Text;

            if (!Validator.IsValidString(code))
            {
                GUIutils.ShowMessage(" COde Is Not Valid");
                return;
            }

            if (Party.Isexist(code))
            {
                GUIutils.ShowMessage(" Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(desc))
            {
                GUIutils.ShowMessage(" Name Is Not Valid");
                return;
            }


            if (!Validator.IsValidString(ad1))
            {
                GUIutils.ShowMessage(" Address Is Not Valid");
                return;
            }

            if (!Validator.IsValidString(ph))
            {
                GUIutils.ShowMessage(" Phone No Is Not Valid");
                return;
            }

            if (!Validator.IsValidString(city))
            {
                GUIutils.ShowMessage(" City Is Not Valid");
                return;
            }



            Party.AddParty(code, desc, acc, ad1, ad2, ph, fax, city, de);
            vad.Clear();
            desctxt.Clear();
            accodetxt.Clear();
            ad1txt.Clear();
            ad2txt.Clear();
            phtxt.Clear();
            faxtxt.Clear();
            citytxt.Clear();
            detxt.Clear();
        }
예제 #30
0
        private void updatebtn_Click(object sender, EventArgs e)
        {
            string icode = codetxt.Text;
            string idesc = desctxt.Text;
            string grp   = grouptxt.Text;
            string vend  = vendortxt.Text;
            string unit  = unittxt.Text;


            if (!Validator.IsValidString(icode))
            {
                GUIutils.ShowMessage("Item COde Is Not Valid");
                return;
            }

            if (!Items.Isexist(icode))
            {
                GUIutils.ShowMessage("Item Code doesnt  Exists");
                return;
            }

            if (!Validator.IsValidString(idesc))
            {
                GUIutils.ShowMessage("Item Name Is Not Valid");
                return;
            }

            if (!Validator.IsValidNumber(ratetxt.Text))
            {
                GUIutils.ShowMessage("Rate should be Numeric Value");
                return;
            }

            if (!Validator.IsValidNumber(qntytxt.Text))
            {
                GUIutils.ShowMessage("Quantity should be Numeric Value");
                return;
            }

            if (!Validator.IsValidNumber(svaltxt.Text))
            {
                GUIutils.ShowMessage("Sock Value should be Numeric Value");
                return;
            }

            decimal rate = Convert.ToDecimal(ratetxt.Text);
            decimal qty  = Convert.ToDecimal(qntytxt.Text);
            decimal val  = Convert.ToDecimal(svaltxt.Text);

            DataTable dt = Group.ListGroup();

            foreach (DataRow dr in dt.Rows)
            {
                if (grp.Trim() == dr["gname"].ToString().Trim())
                {
                    gcode = dr["gcode"].ToString().Trim();
                }
            }

            DataTable dt1 = Unit.ListUnit();

            foreach (DataRow dr1 in dt1.Rows)
            {
                if (unit.Trim() == dr1["uname"].ToString().Trim())
                {
                    ucode = dr1["ucode"].ToString().Trim();
                }
            }

            DataTable dt3 = Party.ListParty();

            foreach (DataRow dr3 in dt3.Rows)
            {
                if (vend.Trim() == dr3["pname"].ToString().Trim())
                {
                    pcode = dr3["pcode"].ToString().Trim();
                }
            }

            Items.UpdateItem(icode, idesc, gcode, ucode, rate, qty, val, pcode);
            codetxt.Clear();
            desctxt.Clear();
            grouptxt.Clear();
            unittxt.Clear();
            qntytxt.Clear();
            svaltxt.Clear();
            vendortxt.Clear();
            ratetxt.Clear();
        }