Ejemplo n.º 1
0
        private void cmbFromAcc_SelectedIndexChanged(object sender, EventArgs e)
        {
            string GetFromAccID = "";
            GetFromAccID = MyCommon.GetSelectedID(cmbFromAcc, true);
            string Currentcy = "";
            txtExRate.Text = MyAccount.GetExRate(GetFromAccID, out Currentcy).ToString();
            lblCurrentcy.Text = Currentcy;
            decimal FinalBalance = 0;
            string rspt = MyAccount.GetFinalBalance(GetFromAccID, Program.AccountStatic.CurrentAccPeriod, out FinalBalance);
            lblBalance.Text = FinalBalance.ToString("##0.00");
            if (GetFromAccID == "10000")
            {
                ComboboxItem cmb = new ComboboxItem();
                cmbPayMethod.Text = cmb.GetReleventTextFromID(cmbPayMethod, "1", true);
                cmbPayMethod.Enabled = false;

            }
            else
                cmbPayMethod.Enabled = true;
        }
Ejemplo n.º 2
0
        private void DisplayExtDetails(string PVN)
        {

            string respond = "";
            respond = MyPay.GetExistPayment_General(PVN, out _ExtData);
            ComboboxItem cmb = new ComboboxItem();
            if (respond == "True")
            {
                //Added By manju
                if (_ExtData.PayStatus == 3)
                {
                    btnPrint.Enabled = true;
                }
                txtPVNno.Text = _ExtData.PaymentID;
                cmbFromAcc.Text = cmb.GetReleventTextFromID(cmbFromAcc, _ExtData.AccountID, true);
                cmbPayFor.Text = cmb.GetReleventTextFromID(cmbPayFor, _ExtData.PayToCatID.ToString(), true);
                cmbPayMethod.Text = cmb.GetReleventTextFromID(cmbPayMethod, _ExtData.PaymentMethod.ToString(), true);
                cmbPayTo.Text = _ExtData.PayToName;
                cmbPayTo_SelectedIndexChanged(null, null);
                txtfromMemo.Text = _ExtData.Description;
                dtpPVNDate.Value = _ExtData.PayActualDate;
                if (_ExtData.IsAdvancePayment == 1)
                    chkAsAdvancePayment.Checked = true;
                else
                    chkAsAdvancePayment.Checked = false;
                DataTable tb = MyPay.GetPAyDetailList(PVN);
                MyCommon.LoadDatatoTableWithoutBind(dgvAccList, tb, "Load Payment list");
                CalTotalLine();
            }
            tabControl1.SelectTab(0);
        }
Ejemplo n.º 3
0
        private void DisplayExtDetails(string RcptNumber)
            {

            string respond = "";
            respond = MyReceipt.GetExistReceipt(RcptNumber, out _ExtData);
            ComboboxItem cmb = new ComboboxItem();
            if (respond == "True")
                {
                txtRcptNumber.Text = _ExtData.ReceiptID;
                cmbFromAcc.Text = cmb.GetReleventTextFromID(cmbFromAcc, _ExtData.AccountID, true);
                cmbPayFor.Text = cmb.GetReleventTextFromID(cmbPayFor, _ExtData.RcptFromCatID.ToString(), true);
                cmbPayMethod.Text = cmb.GetReleventTextFromID(cmbPayMethod, _ExtData.ReceiptMethod.ToString(), true);
                cmbPayTo.Text = _ExtData.RcptFromName;
                cmbPayTo_SelectedIndexChanged(null, null);
                txtfromMemo.Text = _ExtData.Description;
                dtpPVNDate.Value = _ExtData.RcptActualDate;
                DataTable tb = MyReceipt.GetReceiptDetailsList(RcptNumber);
                MyCommon.LoadDatatoTableWithoutBind(dgvAccList, tb, "Load Payment list");
                CalTotalLine();
                }
            tabControl1.SelectTab(0);
            }
Ejemplo n.º 4
0
        private void DisplayExistingData(string InvoiceNumber,int SupID)
        {
           
            string respond = MyBill.GetExistBilling(InvoiceNumber,SupID, out _ExtData);
            ComboboxItem cmb=new ComboboxItem ();

            if (respond == "True")
            {
                DataTable tb = MyBill.GetBillList(InvoiceNumber);
                MyCommon.LoadDatatoTableWithoutBind(dgvAccount, tb, "load Details");
                //cmbSupplier.Text = cmb.GetReleventTextFromID(cmbSupplier, _ExtData.PayToID.ToString(), true);
                //Edited by manjula

                cmbSupplier_SelectedIndexChanged(null, null);
                //Added by Manju
                StatusAll = 9;
                LINKPayment objLink = new LINKPayment();
                objLink.Status = 9;
                objLink.SupName = cmbSupplier.SelectedValue.ToString();
                LoadGRN(objLink);
                cmbGRN.Text = _ExtData.BillNo;
                cmbGRN_SelectedIndexChanged(null, null);
                StatusAll = 0;

                txtDescription.Text = _ExtData.Description;
                dtpBilingDate.Value = _ExtData.BillDate;
                lblExchangerate.Text = _ExtData.CurRate.ToString("#0.00");
                CalTotalAmount();
                tabControl1.SelectTab(0);
            }
        }
Ejemplo n.º 5
0
        public void GetCustomerMaster()
        {
            try
            {
                Finance.MRPServiceReference.ServiceClient objService = new Finance.MRPServiceReference.ServiceClient();
                List<EntityHandler.CustomerMaster> objList = new List<EntityHandler.CustomerMaster>();
                EntityHandler.CustomerMaster [] objArry = objService.GetCustomerMaster();
                objList = new BusinessHandler.CustomerMaster().BALGetCustomerMaster();
            
                cmbSupplier.Items.Clear();
                ComboboxItem itemDefault = new ComboboxItem();
                itemDefault.Text = "--Select--";
                itemDefault.Value = "0";
                cmbSupplier.Items.Add(itemDefault);

                for (int i = 0; i < objArry.Length; i++)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = objArry[i].Name;
                    item.Value = objArry[i].Customer_Code;
                    cmbSupplier.Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 6
0
        public void LoadToComboWithSelectedValue(ComboBox ObgCombo, string CmdStr,string ID,string Textvalue)
        {
            
            DataTable mytb = new DataTable();
            mytb = GetDataTable(CmdStr, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r[Textvalue].ToString();
                    item.Value = r[ID].ToString();
                    ObgCombo.Items.Add(item);
                }
            }


        }
Ejemplo n.º 7
0
        public void LoadStatusComboAccount(ComboBox ObgCombo, string CmdStr)
        {
            DataTable mytb = new DataTable();
            mytb = GetDataTableAccount(CmdStr, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r[1].ToString();
                    item.Value = r[0].ToString();
                    ObgCombo.Items.Add(item);

                }
            }


        }
Ejemplo n.º 8
0
 private void InitializeScreen()
 {
     ComboboxItem cmb = new ComboboxItem();
     MyCommon.ClearCurrentPanel(ref panel7);
     MyAccount.LoadAccountType (cmbAccountType);
     MyAccount.LoadAccountType(cmbSearchAccType);
     MyCommon.LoadStatusComboAccount(cmbAccStatus, 1);
     MyAccount.LoadCurrency(cmbCurrenyType);
     cmbCurrenyType.Text = cmb.GetReleventTextFromID(cmbCurrenyType,"LKR", true);
     cmbAccStatus.Text = cmb.GetReleventTextFromID(cmbAccStatus, "1", true);
 }
Ejemplo n.º 9
0
        public void LoadCurrency(ComboBox ObgCombo)
        {
            string sql1 = "select CurID,CurID from tblcurrency";
            DataTable mytb = new DataTable();
            mytb = Mycommon.GetDataTableAccount(sql1, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r["CurID"].ToString();
                    item.Value = r["CurID"].ToString();
                    ObgCombo.Items.Add(item);

                }
            }
        }
Ejemplo n.º 10
0
 private void DisplayExtData(string  AccNo)
 {
     AccountType.AccountCreationDataType _Savedata = new AccountType.AccountCreationDataType();
     string respond = MyAccount.GetExistAccountCreation(AccNo, out _Savedata);
     InitializeScreen();
       ComboboxItem cmb = new ComboboxItem();
     if (respond == "True")
     {
         txtAccID.Text = _Savedata.AccountID.ToString ();
         txtAccountDescription.Text = _Savedata.AccountName;
         cmbAccountType.Text = cmb.GetReleventTextFromID(cmbAccountType, _Savedata.MainAccType.ToString(), true);
         if (_Savedata.IsSubAccount == 1)
         { chkIsSubaccount.CheckState = CheckState.Checked;
             cmbMainAccount.Text = cmb.GetReleventTextFromID(cmbMainAccount, _Savedata.MainAccountID.ToString (), true);
         }
         else
             chkIsSubaccount.CheckState = CheckState.Unchecked;
         cmbCurrenyType.Text = cmb.GetReleventTextFromID(cmbCurrenyType, _Savedata.Currency , true);
         cmbBankAccountNo.Text = _Savedata.BankAccountNo;
         cmbAccStatus.Text = cmb.GetReleventTextFromID(cmbAccStatus, _Savedata.AccountStatus.ToString (), true);
         
     }
 }
Ejemplo n.º 11
0
 private void cmbSearchAccType_SelectedIndexChanged(object sender, EventArgs e)
 {
     ComboboxItem cmb = new ComboboxItem();
     string CatID = cmb.GetReleventTextFromID(cmbSearchAccType, cmbSearchAccType.Text, false);
     DataTable tb = MyAccount.GetAccountListByCat(Program.AccountStatic.CompanyID, 1, int.Parse(CatID));
     MyCommon.LoadDatatoTableWithoutBind(dgvAccountList, tb, "Load Account List");
 }
Ejemplo n.º 12
0
        private void cmbAccountType_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboboxItem cmb = new ComboboxItem();
            if (cmb.GetReleventTextFromID(cmbAccountType, cmbAccountType.Text, false) == "1")

                cmbBankAccountNo.Enabled = true;
            else
                cmbBankAccountNo.Enabled = false;
        }
Ejemplo n.º 13
0
 private string SetDataToCLass(out AccountType.AccountCreationDataType _Savedata)
 {
     ComboboxItem cmb=new ComboboxItem();
     _Savedata = new AccountType.AccountCreationDataType();
     _Savedata.AccountID = txtAccID.Text;
     _Savedata.AccountName = txtAccountDescription.Text;
     _Savedata.AccountStatus = int.Parse(cmb .GetReleventTextFromID(cmbAccStatus,cmbAccStatus.Text ,false));
     _Savedata.BankAccountNo = cmbBankAccountNo.Text;
     _Savedata.CreatedUser = Program.AccountStatic.UserName;
     _Savedata.Currency = cmbCurrenyType.Text;
     if (chkIsSubaccount.CheckState == CheckState.Checked)
     {
         _Savedata.IsSubAccount = 1;
         _Savedata.MainAccountID = cmb.GetReleventTextFromID(cmbMainAccount, cmbMainAccount.Text, false  ); 
     }
     else
     {
         _Savedata.IsSubAccount = 0;
         _Savedata.MainAccountID = "0";
     }
     _Savedata.lastaccdate = DateTime.Today;
     _Savedata.MainAccType = int.Parse(cmb.GetReleventTextFromID(cmbAccountType, cmbAccountType.Text, false));
     _Savedata.CompanyID = Program.AccountStatic.CompanyID;
     return "True";
 }
Ejemplo n.º 14
0
        private void cmbCurrency_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboboxItem cmb = new ComboboxItem();

            lblExrate.Text = cmb.GetReleventTextFromID(cmbCurrency, cmbCurrency.Text, false);
        }
Ejemplo n.º 15
0
        private void dgvAccList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            ComboboxItem cmb = new ComboboxItem();

            if (e.RowIndex != -1)
            {
                lblLRef.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_Ref"].Value.ToString();
                lblToID.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_AccountID"].Value.ToString();
                txtToAccount.Text = MyAccount.GetAccountName(lblToID.Text);
                txtToMemo.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_Memo"].Value.ToString();
                txtJobNumber.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_Job"].Value.ToString();
                txtVat.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_Vat"].Value.ToString();
                txtAmount.Text = dgvAccList.Rows[e.RowIndex].Cells["dgvAccList_Fcur"].Value.ToString();
            }
        }
Ejemplo n.º 16
0
        public void LoadAccountType(ComboBox ObgCombo)
        {
           
            string sql1 = "select SysID,AccountType from accounttype";
            DataTable mytb = new DataTable();
            mytb = Mycommon.GetDataTableAccount(sql1, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r["AccountType"].ToString();
                    item.Value = r["SysID"].ToString();
                    ObgCombo.Items.Add(item);

                }
            }
        }
Ejemplo n.º 17
0
        public string GetSelectedID(ComboBox cmb,bool GetValue)
        {
   
            ComboboxItem cmbItem = new ComboboxItem();
            try
            {
                cmbItem = (ComboboxItem)cmb.SelectedItem;
                if (GetValue)
                    return cmbItem.Value.ToString();
                else
                    return cmbItem.Text;
            }
            catch (Exception ex)
            {

                return "";
            }

        }
Ejemplo n.º 18
0
        public void LoadBankAccount(ComboBox ObgCombo)
            {
            string sql1 = "SELECT AccountNo,concat(AccountNo,' [', AccountType,'-', CurrenyType,']') as AcName "
                + " FROM tblbankaccount ";

            DataTable mytb = new DataTable();
            mytb = Mycommon.GetDataTableAccount(sql1, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
                {
                foreach (DataRow r in mytb.Rows)
                    {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r["AccountNo"].ToString();
                    item.Value = r["AcName"].ToString();
                    ObgCombo.Items.Add(item);

                    }
                }
            }
Ejemplo n.º 19
0
        public void LoadStatusCombo(ComboBox ObgCombo, int Type)
        {
            string CmdStr = "Select ID,StatusName from tblcombostatus where Category=" + Type + " Order by ID asc";
            DataTable mytb = new DataTable();
            mytb = GetDataTable(CmdStr, "Load Status Combo"); 
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows )
                {
                  ComboboxItem item = new ComboboxItem();
                  item.Text  = r["StatusName"].ToString();
                  item.Value = r["ID"].ToString();
                  ObgCombo.Items.Add(item);
                  
                }
            }
            
           
        }
Ejemplo n.º 20
0
        public void LoadMainAccount(ComboBox ObgCombo,int CompanyID)
        {
            string sql1 = "SELECT AccountID ,  AccountName "
                + " FROM accountname where CompanyID=" + CompanyID + " order by AccountID asc";
            DataTable mytb = new DataTable();
            mytb = Mycommon.GetDataTableAccount(sql1, "Load Status Combo");
            ObgCombo.Items.Clear();

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text = r["AccountName"].ToString() +" [" +  r["AccountID"].ToString() + "]" ;
                    item.Value = r["AccountID"].ToString();
                    ObgCombo.Items.Add(item);

                }
            }
        }
Ejemplo n.º 21
0
        public void LoadStatusComboWithExtraword(ComboBox ObgCombo, string CmdStr,string IDvalue,string Displaytext)
        {

            // string CmdStr = "Select ID,StatusName from tblcombostatus where Category=" + Type + " Order by ID asc";
            DataTable mytb = new DataTable();
            mytb = GetDataTable(CmdStr, "Load Status Combo");
            ObgCombo.Items.Clear();

            ComboboxItem item = new ComboboxItem();
            item.Text = Displaytext;
            item.Value = IDvalue;
            ObgCombo.Items.Add(item);

            if (mytb != null)
            {
                foreach (DataRow r in mytb.Rows)
                {
                    item = new ComboboxItem();
                    item.Text = r[1].ToString();
                    item.Value = r[0].ToString();
                    ObgCombo.Items.Add(item);

                }
            }


        }
Ejemplo n.º 22
0
        public void  GetAccountListByCat(int CompanyName,ComboBox cmb, int CatID)
        {
            string sql1 = "";
            if (CatID != 0)
            {
                sql1 = "SELECT accountname.AccountID , accountname.AccountName "
                    + " FROM accountname "
                    + " where AccountStatus=1 and accountname.CompanyID=" + CompanyName + "  and accountname.MainAccType=" + CatID + " Order By accountname.AccountID Asc";
            }
            else
            {
                sql1 = "SELECT accountname.AccountID , accountname.AccountName "
                     + " FROM accountname "
                     + " where AccountStatus=1 and accountname.CompanyID=" + CompanyName + " Order By accountname.AccountID Asc";
            }

            DataTable tb = Mycommon.GetDataTableAccount(sql1, "Get Account List");
            cmb.Items.Clear(); 
            if (tb != null)
            {
                foreach (DataRow r in tb.Rows)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text =  r["AccountName"].ToString() +" [" + r["AccountID"].ToString() + "]" ;
                    item.Value = r["AccountID"].ToString();
                    cmb.Items.Add(item);

                }
            }


                
               
        }
Ejemplo n.º 23
0
 private void cmbCompanyName_SelectedIndexChanged(object sender, EventArgs e)
 {
     ComboboxItem cmb=new ComboboxItem ();
     Program.AccountStatic.CompanyID = int.Parse(cmb.GetReleventTextFromID(cmbCompanyName, cmbCompanyName.Text, false));
     txtUserName.Enabled = true;
     txtPWD.Enabled = true; 
 }
Ejemplo n.º 24
0
        private void DisplayData()
        {
            ComboboxItem cmb = new ComboboxItem();

            cmbGRN.Text = _saveData.InvoiceNo;
            cmbSupplier.Text = cmb.GetReleventTextFromID(cmbSupplier, _saveData.RcvFromID.ToString (), true);
            dtpInvoiceDate.Value = _saveData.InvoiceDate;
       //     dtpBilingDate.Value =  _saveData.
            txtDescription.Text = _saveData.Description;
            DataTable tb = MyInvoice.GetExistInvoiceDetails(cmbGRN.Text);
            lblDueDate.Text = _saveData.TobeRcvDate.ToString("dd/MMM/yyyy");
            MyCommon.LoadDatatoTableWithoutBind(dgvAccount, tb, "Load deails");
            CalTotalAmount();
            tabControl1.SelectTab(0);
        }