Exemplo n.º 1
0
        private LINKPayment ConvertToObjectSupplier(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                 obj.SupName = row["SupName"].ToString();
            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 2
0
        private LINKPayment ConvertToObjectInvoice(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.InvoiceID = row["InvoiceID"].ToString();
                obj.InvoiceDate = Convert.ToDateTime(row["InvoiceDate"].ToString());
                obj.Value = Convert.ToDecimal(row["Value"].ToString());
                obj.SupplierID = Convert.ToInt32(row["SupplierID"].ToString());

            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 3
0
        private LINKPayment ConvertToObjectVoucher(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.VoucherID = row["VoucherID"].ToString();
                obj.VoucherDate = Convert.ToDateTime(row["Voucherdate"].ToString());
                obj.Value = Convert.ToDecimal(row["Value"].ToString());
                obj.AccNo = row["AccNo"].ToString();
                obj.ApproveDate = Convert.ToDateTime(row["ApproveDate"].ToString());

            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 4
0
        public DataTable DALGetLastPayment(LINKPayment objPayment)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_GetLastPayment";

                oSqlCommand.Parameters.AddWithValue("@SupplierID", objPayment.SupplierID);
                oSqlCommand.CommandText = SqlQuery;

                dt = new DALBase().SelectSPFinance(oSqlCommand);
                dt.TableName = "tblInvoice";
            }
            catch (Exception ex)
            { }
            return dt;
        }
Exemplo n.º 5
0
        public DataTable DALGetFinalCreditor(LINKPayment objPayment)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_PaymentCreditorFinal";

                oSqlCommand.Parameters.AddWithValue("@SupName", objPayment.SupName);
                oSqlCommand.CommandText = SqlQuery;

                dt = new DALBase().SelectSPMRP(oSqlCommand);
                dt.TableName = "tblSupplier";
            }
            catch (Exception ex)
            { }
            return dt;
        }
Exemplo n.º 6
0
        private LINKPayment ConvertToObject(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.SupplierCode = row["SupplierCode"].ToString();
                obj.SupName = row["SupName"].ToString();
                obj.Tot = Convert.ToDecimal(row["Tot"].ToString());
                obj.NoDays = Convert.ToInt32(row["NoDays"].ToString());
                obj.SupAddress = row["SupAddress"].ToString();
                obj.SupContact = row["SupPhone"].ToString();
                obj.SupplierID = Convert.ToInt32(row["SupplierID"].ToString());
                obj.CreditPeriod = Convert.ToInt32(row["CreditPeriod"].ToString());

            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 7
0
        public List<LINKPayment> BALGetFinalCreditor(LINKPayment objPayment)
        {
            List<LINKPayment> listobj = new List<LINKPayment>();
            DataTable dt = new DataTable();
            try
            {
                DALPayment objDALPayment = new DALPayment();
                dt = objDALPayment.DALGetFinalCreditor(objPayment);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    listobj.Add(ConvertToObject(dt.Rows[i]));
                }
            }
            catch (Exception ex)
            {

            }

            return listobj;
        }
Exemplo n.º 8
0
        public List<LINKPayment> BALGetInvoice(LINKPayment objPayment)
        {
            List<LINKPayment> listobj = new List<LINKPayment>();
            DataTable dt = new DataTable();
            try
            {
                DataAccessHandler.Voucher objDALPayment = new DataAccessHandler.Voucher();
                dt = objDALPayment.DALGetInvoice(objPayment);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    listobj.Add(ConvertToObjectInvoice(dt.Rows[i]));
                }
            }
            catch (Exception ex)
            {

            }

            return listobj;
        }
Exemplo n.º 9
0
         public bool BALInsertVoucher(LINKPayment objPayment, List<LINKPayment> objLists)
        {
            bool status = false;

            try
            {
                DataAccessHandler.Voucher objDALPayment = new DataAccessHandler.Voucher();
                LINKPayment objLink = new LINKPayment();

                if (objLists.Count > 0)
                {
                    status = objDALPayment.DALInsertVoucher(objPayment);

                    if (status)
                    {
                        foreach (LINKPayment objList in objLists)
                        {
                            objLink.VoucherID = objList.VoucherID;
                            objLink.InvoiceID = objList.InvoiceID;

                            status = objDALPayment.DALInsertVoucherFromInvoive(objLink);


                            if (status)
                            {
                                //update tblGRN set status=9
                                status = objDALPayment.DALInvoiceStatus(objLink);
                            }

                        }
                    }

                }

            }
            catch (Exception ex)
            {

            }
            return status;
        }
Exemplo n.º 10
0
        //Update MRP Database
        public bool DALGRNStatus(LINKPayment objPayment)
        {
            bool status = false;
            int GRNstatus = 9;

            try
            {
                SqlConnection conn = DALConnManager.OpenMRP();
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_UpdateStatusGRN";

                oSqlCommand.Connection = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@Status", GRNstatus);
                oSqlCommand.Parameters.AddWithValue("@GRNNo", objPayment.GRNNo);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);


            }
            catch (Exception ex)
            {

            }

            return status;
        }
Exemplo n.º 11
0
        public bool DALVoucherIDStatus(LINKPayment objPayment)
        {
            bool status = false;
            int GRNstatus = 9;

            try
            {
                SqlConnection conn = DALConnManager.OpenFinance();
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_UpdateStatustblVoucher";

                oSqlCommand.Connection = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@Status", GRNstatus);
                oSqlCommand.Parameters.AddWithValue("@VoucherID", objPayment.VoucherID);
                oSqlCommand.Parameters.AddWithValue("@ApproveDate", objPayment.ApproveDate);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);


            }
            catch (Exception ex)
            {

            }

            return status;
        }
Exemplo n.º 12
0
        public bool DALInsertInvoiceFromGRN(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn = DALConnManager.OpenFinance();
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_PaymentInserIntoInvoiceFromGRN";

                oSqlCommand.Connection = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);
                oSqlCommand.Parameters.AddWithValue("@GRNNo", objPayment.GRNNo);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);


            }
            catch (Exception ex)
            {
            }

            return status;
        }
Exemplo n.º 13
0
        //add by manjula
        private void LoadGRNMaterial(LINKPayment objLink)
        {
            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add("Amount");
            dt.Columns.Add("Qty");
            dt.Columns.Add("Name");
            dt.Columns.Add("AccNo");
            dt.Columns.Add("MaterialCode");
            dt.Columns.Add("PONo");

            LINKPayment[] objSupList = objService.GetGRNMaterial(objLink);
            if (objSupList.Length > 0)
            {
                for (int j = 0; j < objSupList.Length; j++)
                {

                    dr = dt.NewRow();

                    dr[0] = Math.Round(objSupList[j].Tot,2);
                    dr[1] = Math.Round(objSupList[j].Value,2);
                    dr[2] = objSupList[j].Description.ToString();
                    dr[3] = objSupList[j].AccNo.ToString();
                    dr[4] = objSupList[j].MaterialCode.ToString();
                    dr[5] = "9988";

                    dt.Rows.Add(dr.ItemArray);
                }

                dtpGRNDetals.Columns.Clear();
                DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();
                checkColumn.TrueValue = true;
                checkColumn.FalseValue = false;
                checkColumn.Name = "Select";
                checkColumn.HeaderText = "Select";
                checkColumn.Width = 50;
                checkColumn.ReadOnly = true;
                checkColumn.FillWeight = 10; //if the datagridview is resized (on form resize) the checkbox won't take up too much; value is relative to the other columns' fill values
             
                dtpGRNDetals.Columns.Add(checkColumn);

                dtpGRNDetals.DataSource = null;
                dtpGRNDetals.DataSource = dt;


                for (int i = 0; i < dtpGRNDetals.Rows.Count; i++)
                {
                    dtpGRNDetals.Rows[i].Cells[0].Value = true;
                }

            }else
            {
                dtpGRNDetals.DataSource = null;
                dtpGRNDetals.Columns.Clear();
            }
        }
Exemplo n.º 14
0
        public bool BALUpdateMaterial(LINKPayment objPayment)
        {
            DALPayment objDALPayment = new DALPayment();

            return objDALPayment.DALUpdateMaterial(objPayment);
        }
Exemplo n.º 15
0
        public bool DALUpdateMaterial(LINKPayment objPayment)
        {
            bool result = false;

            try
            {
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_UpdateStatusGRNMateril";
                oSqlCommand.Parameters.AddWithValue("@Status", objPayment.Status);
                oSqlCommand.Parameters.AddWithValue("@GRNNO", objPayment.GRNNo);
                oSqlCommand.Parameters.AddWithValue("@MaterialCode", objPayment.MaterialCode);
                oSqlCommand.CommandText = SqlQuery;
                result = new DALBase().UpdateMRP(oSqlCommand);
            }
            catch (Exception ex)
            {

                StreamWriter file2 = new StreamWriter(@"c:\file.txt", true);
                file2.WriteLine(ex.ToString() + "- " + DateTime.Now + "- meeeeeeeeeeeee");
                file2.Close();
            }

            return result;
        }
Exemplo n.º 16
0
         public bool BALUpdateVoucher(LINKPayment objPayment)
         {
             bool status = false;

             try
             {
                 DataAccessHandler.Voucher objDALPayment = new DataAccessHandler.Voucher();

                 //update tblGRN set status=9
                 status = objDALPayment.DALVoucherIDStatus(objPayment);


             }
             catch (Exception ex)
             {

             }
             return status;
         }
Exemplo n.º 17
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);
            }
        }
Exemplo n.º 18
0
        private void brnShow_Click(object sender, EventArgs e)
        {
            //Edited by manjula
            string SupName = cmbSearchSupplier.SelectedValue.ToString();
            LINKPayment objLink = new LINKPayment();
            objLink.SupName = SupName;
            LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

            if (objSuppID.Length > 0)
            {
                supid = objSuppID[0].SupplierID.ToString();
            }
            LoadBillList(supid);
    
        }
Exemplo n.º 19
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            
            if (MessageBox.Show("Do you want to Save current record ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) ;
            {
                BillingDataTypes.BillingDataType _SaveData = new BillingDataTypes.BillingDataType();
                string respond = SetDataToPayBill(out _SaveData);
                if (!MyBill.ExistBilling(_SaveData.BillNo, _SaveData.PayToID))
                {
                    int BillStatus = -1;
                    int SupID = Convert.ToInt32(supid);
                    BillStatus = MyBill.GetBillStatus(cmbGRN.Text, Convert.ToInt32(supid));
                    if (BillStatus == 0)
                    {

                        if (respond == "True")
                        {
                           respond = MyBill.Save(_SaveData);

                            if (respond == "True")
                            {
                                //Edit by manjula
                                //********************************* update tblmaterials
                                bool res = false;
                                LINKPayment objList;
                                

                                for (int i = 0; i < dtpGRNDetals.Rows.Count; i++)
                                {
                                    if (Convert.ToBoolean(dtpGRNDetals.Rows[i].Cells[0].Value) == true)
                                    {
                                        objList = new LINKPayment();
                                        objList.Status = 9;
                                        objList.GRNNo = cmbGRN.SelectedValue.ToString();
                                        objList.MaterialCode = dtpGRNDetals.Rows[i].Cells["MaterialCode"].Value.ToString();

                                        res = objService.SetMaterialStatus(objList);
                                    }
                                }


                                Program.InformationMessage("Record saved successfully");
                               // LoadBillList(MyCommon.GetSelectedID(cmbSupplier, true));

                                LoadBillList(SupID.ToString());

                                //Added by manju
                                LINKPayment objLink = new LINKPayment();
                                objLink.SupName = cmbSupplier.SelectedValue.ToString();
                                objLink.Status = 0;
                                LoadGRN(objLink);

                                dtpGRNDetals.Columns.Clear();
                                dtpGRNDetals.DataSource = null;

                            }
                            else
                                Program.VerningMessage(respond);
                        }
                        else
                            Program.VerningMessage(respond);
                    }
                    else
                    {
                        switch (BillStatus)
                        {
                            
                            case 2:
                                Program.VerningMessage("You cannot chage any details of this bill , Tt is already approved" );
                                break;
                            case 3:
                                Program.VerningMessage("You cannot chage any details of this bill, It is already accounted");
                                break;
                            default:
                                break;
                        }
                    }
                }
                else
                {
                    Program.VerningMessage("Use Update Button to update details");
                }
            }
            
        }
Exemplo n.º 20
0
        private void cmbGRN_SelectedIndexChanged(object sender, EventArgs e)
            {
                // string supid = MyCommon.GetSelectedID(cmbSupplier,true);
                //Edit by manjula
                //string supid = "0";
                //string SupName = cmbSupplier.SelectedValue.ToString();
                //LINKPayment objLink = new LINKPayment();
                //objLink.SupName = SupName;
                //LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

                //if (objSuppID.Length > 0)
                //{
                //    supid = objSuppID[0].SupplierID.ToString();
                //}

                int SupID = int.Parse(supid);
                //DataTable tb = MyBill.GetGRNData(cmbGRN.Text, SupID);
                //MyCommon.LoadDatatoTableWithoutBind(dtpGRNDetals, tb, "Load GRN");
                LINKPayment objpayment=new LINKPayment();
                objpayment.GRNNo = cmbGRN.SelectedValue.ToString();
                objpayment.Status = StatusAll;
                LoadGRNMaterial(objpayment);

                chkSelect.Checked = true;
                //calTotalValue(); 
                txtDescription.Text = "Purchase of " + cmbGRN.Text;
            }
Exemplo n.º 21
0
        private void cmbSupplier_SelectedIndexChanged(object sender, EventArgs e)
            {
                //string supid = MyCommon.GetSelectedID(cmbSupplier,true);
                //Edit by manjula
                string SupName = cmbSupplier.SelectedValue.ToString();
                string CreditPeriod = "";
                string ACCNo = "";
                LINKPayment objLink = new LINKPayment();
                objLink.SupName=SupName;
                LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

                if (objSuppID.Length > 0)
                {
                    supid = objSuppID[0].SupplierID.ToString();
                    CreditPeriod = objSuppID[0].CreditPeriod.ToString();
                    ACCNo = objSuppID[0].AccNo.ToString();
                }

                int SupID1 = int.Parse(supid);
                lblAccnumber.Text = ACCNo; 

                string curRate = "";
                decimal ExRate = MyAccount.GetExRate(lblAccnumber.Text, out curRate);
                lblExchangerate.Text = ExRate.ToString("#0.000");
                lblCurrency.Text = curRate;
                if (lblCurrency.Text  != "USD")
                    lblExchangerate.Enabled = true;
                else
                    lblExchangerate.Enabled = false;

               // MyBill.LoadGRNNumbers(cmbGRN, SupID1);
               // txtpayterm.Text = MyAccount.GetCreditPeriod(SupID1, true).ToString();
               // lblTotalBillOutstanding.Text = MyBill.GetTotalOutstanding(SupID1).ToString("##0.00");
                objLink.Status = 0;
                LoadGRN(objLink);

                txtpayterm.Text = CreditPeriod;
                lblTotalBillOutstanding.Text = GetOutstandingBill(SupID1).ToString();  //**************** load tot outsatnding of suuplier here

            }
Exemplo n.º 22
0
        private LINKPayment ConvertToObjectGRN(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.GRNNo = row["GRNNO"].ToString();
                obj.GRNApprovedate = Convert.ToDateTime(row["GRNApproveDate"].ToString());
                obj.Tot = Convert.ToDecimal(row["Tot"]);
                obj.NoDays = Convert.ToInt32(row["NoDays"]);
            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 23
0
        private LINKPayment ConvertToObjectGRNMaterial(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.Tot = Convert.ToDecimal(row["AMOUNT"].ToString());
                obj.Value =Convert.ToDecimal(row["PN"].ToString());
                obj.Description = row["NAME"].ToString();
                obj.AccNo = row["AccNo"].ToString();
                obj.MaterialCode = row["MaterialCode"].ToString();

            }
            catch (Exception ex)
            { }
            return obj;
        }
Exemplo n.º 24
0
        private void btnApproved_Click(object sender, EventArgs e)
        {
            string PayFor = "";
            if (MessageBox.Show("Do you want approved this payment ? ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                string respond = "";
                int VoucherStatus = MyPay.GetPVNStatus(txtPVNno.Text);
                switch (VoucherStatus)
                {
                    case 0:
                        Program.VerningMessage("This is not in approval stage !!!......");
                        break;
                    case 1:
                        respond = MyPay.SetPaymentVoucherAsApproved(txtPVNno.Text, Program.AccountStatic.UserName);
                        if (respond == "True")
                        {
                            PayFor = MyCommon.GetSelectedID(cmbPayFor, true);
                            //string PayToID = MyCommon.GetSelectedID(cmbPayTo, true);
                            //Added by manju
                            string PayToID = "";
                            string SupName = cmbPayTo.Text;
                            LINKPayment objLink = new LINKPayment();
                            objLink.SupName = SupName;
                            LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

                            if (objSuppID.Length > 0)
                            {
                                PayToID = objSuppID[0].SupplierID.ToString();
                            }            

                            if (PayFor == "1")
                            {
                                foreach (DataGridViewRow r in dgvAccList.Rows)
                                {
                                    decimal amount = 0;
                                    bool redtp = decimal.TryParse(r.Cells["dgvAccList_Fcur"].Value.ToString(), out amount);

                                    string reply = MyPay.UpdatePendingBillAmount(int.Parse(PayToID), r.Cells["dgvAccList_Job"].Value.ToString(), amount);
                                }


                            }
                            Program.InformationMessage("Successfully Approved !!!!");
                        }
                        else
                            Program.VerningMessage(respond);
                        break;
                    case 2:
                        Program.VerningMessage("Already Approved !!!......");
                        break;
                    case 3:
                        Program.VerningMessage("Already Accounted!!! you cannot change ......");
                        break;
                    default:
                        break;
                }
            }
        }
Exemplo n.º 25
0
        private void btnPostTpAcc_Click(object sender, EventArgs e)
        {
            int BillStatus = -1;
            if (MessageBox.Show("Do you want post to account ? ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                MyTransaction = new AccountTranaction(Program.AccountStatic.LoggingAsLocal);
               // int SupID = int.Parse(MyCommon.GetSelectedID(cmbSupplier, true));
                //Edited by manjula
                string SupName = cmbSupplier.SelectedValue.ToString();
                string CreditPeriod = "";
                LINKPayment objLink = new LINKPayment();
                objLink.SupName = SupName;
                LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

                if (objSuppID.Length > 0)
                {
                    supid = objSuppID[0].SupplierID.ToString();
                    CreditPeriod = objSuppID[0].CreditPeriod.ToString();
                }

                int SupID = Convert.ToInt32(supid);

                BillStatus = MyBill.GetBillStatus(cmbGRN.Text, SupID);
                if (BillStatus == 2)
                {
                    string respond = ""; // 
                         respond = MyTransaction.DoBillTransaction(_ExtData);
                        if (respond == "True")
                        {
                            respond = MyBill.BillAccount(cmbGRN.Text, Program.AccountStatic.UserName, SupID);

                            if (respond == "True")
                            {
                                Program.InformationMessage("Successfully  Approved");
                            }
                            else
                            {
                                Program.VerningMessage(respond);
                            }
                        }
                        else
                            Program.VerningMessage(respond);
                }
                else
                {
                    if (BillStatus == 0)
                    {
                        Program.VerningMessage("This is not send to approval !!!");

                    }
                    else if (BillStatus == 1)
                    {
                        Program.VerningMessage("This is not Approved Bill !!!");
                    }
                    else if (BillStatus == 3)
                    {
                        Program.VerningMessage("This Bill Already Accounted !!!");
                    }
                }
            }
        }
Exemplo n.º 26
0
        public bool DALInsertInvoice(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn = DALConnManager.OpenFinance();
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_PaymentInserIntoInvoice";

                oSqlCommand.Connection = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);
                oSqlCommand.Parameters.AddWithValue("@ID", objPayment.ID);
                oSqlCommand.Parameters.AddWithValue("@InvoiceDate", objPayment.InvoiceDate);
                oSqlCommand.Parameters.AddWithValue("@Value", objPayment.Value);
                oSqlCommand.Parameters.AddWithValue("@CreateDate", objPayment.CreateDate);
                oSqlCommand.Parameters.AddWithValue("@CreateUser", objPayment.CreateUser);
                oSqlCommand.Parameters.AddWithValue("@Modifieddate", objPayment.Modifieddate);
                oSqlCommand.Parameters.AddWithValue("@ModifiedUser", objPayment.ModifiedUser);
                oSqlCommand.Parameters.AddWithValue("@Status", objPayment.Status);
                oSqlCommand.Parameters.AddWithValue("@SupplierID", objPayment.SupplierID);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);


            }
            catch (Exception ex)
            {
            }

            return status;
        }
Exemplo n.º 27
0
        public DataTable DALGetGRNMaterial(LINKPayment objPayment)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_GRNMaterials";

                oSqlCommand.Parameters.AddWithValue("@GRNNO", objPayment.GRNNo);
                oSqlCommand.Parameters.AddWithValue("@Status", objPayment.Status);
                oSqlCommand.CommandText = SqlQuery;

                dt = new DALBase().SelectSPMRP(oSqlCommand);
                dt.TableName = "tblGRNMaterials";
            }
            catch (Exception ex)
            { }
            return dt;
        }
Exemplo n.º 28
0
        //add by manjula
        private void LoadGRN(LINKPayment objLink)
        {
            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add("GRNNO");
            dt.Columns.Add("GRNNOval");

            LINKPayment[] objSupList = objService.GetCreditorFinalGRN(objLink);
            if (objSupList.Length > 0)
            {
                for (int j = 0; j < objSupList.Length; j++)
                {

                    dr = dt.NewRow();

                    dr[0] = objSupList[j].GRNNo.ToString();
                    dr[1] = objSupList[j].GRNNo.ToString();

                    dt.Rows.Add(dr.ItemArray);
                }

                cmbGRN.DataSource = dt;
                cmbGRN.DisplayMember = "GRNNO";
                cmbGRN.ValueMember = "GRNNOval";
            }
        }
Exemplo n.º 29
0
        public bool DALInsertVoucherFromInvoive(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn = DALConnManager.OpenFinance();
                SqlCommand oSqlCommand = new SqlCommand();
                string SqlQuery = "WCF_PaymentInserIntoVoucherFromInvoice";

                oSqlCommand.Connection = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@VoucherID", objPayment.VoucherID);
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);


            }
            catch (Exception ex)
            {
                //StreamWriter file2 = new StreamWriter(@"c:\file.txt", true);
                //file2.WriteLine(ex.ToString() + "- " + DateTime.Now + "- DAL");
                //file2.Close();
            }

            return status;
        }
Exemplo n.º 30
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            try
            {
                panel14.Visible = true;
                //string PayToID = MyCommon.GetSelectedID(cmbPayTo, true);
                //Edited by Manjula
                string SupName = cmbPayTo.SelectedValue.ToString();
                LINKPayment objLink = new LINKPayment();
                objLink.SupName = SupName;
                LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

                if (objSuppID.Length > 0)
                {
                    PayToID = objSuppID[0].SupplierID.ToString();
                }

                int CusSupID = int.Parse(PayToID);
                DataTable tb = MyPay.GetPendingBillList(CusSupID);
                MyCommon.LoadDatatoTableWithoutBind(dgvBillList, tb, "Load Peng bill");
            }
            catch (Exception ex)
            {


            }
        }