示例#1
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);
        }
示例#2
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";
            }
        }
示例#3
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);
            }
        }
示例#4
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;
        }
示例#5
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)
            {
            }
        }
示例#6
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);
        }
示例#7
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);
        }
示例#8
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);
        }
示例#9
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);
        }
示例#10
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();
            }
        }
示例#11
0
        private LINKPayment ConvertToObjectSupplier(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.SupName = row["SupName"].ToString();
            }
            catch (Exception ex)
            { }
            return(obj);
        }
示例#12
0
        private LINKPayment ConvertToObjectInvoiceAll(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.InvoiceID  = row["InvoiceID"].ToString();
                obj.SupplierID = Convert.ToInt32(row["SupplierID"].ToString());
            }
            catch (Exception ex)
            { }
            return(obj);
        }
示例#13
0
        private void btnApproved_Click(object sender, EventArgs e)
        {
            int BillStatus = -1;

            if (MessageBox.Show("Do you want Approved This ? ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                //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 == 1)
                {
                    string respond = MyBill.BillApproved(cmbGRN.Text, Program.AccountStatic.UserName, SupID);
                    if (respond == "True")
                    {
                        Program.InformationMessage("Successfully  Approved");
                    }
                    else
                    {
                        Program.VerningMessage(respond);
                    }
                }
                else
                {
                    if (BillStatus == 0)
                    {
                        Program.VerningMessage("This is not send to approval !!!");
                    }
                    else if (BillStatus == 2)
                    {
                        Program.VerningMessage("This Bill Already Approved !!!");
                    }
                    else if (BillStatus == 3)
                    {
                        Program.VerningMessage("This Bill Already Accounted !!!");
                    }
                }
            }
        }
示例#14
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);
        }
示例#15
0
        private LINKPayment ConvertToObjectLastPayment(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.ApproveDate = Convert.ToDateTime(row["ApproveDate"].ToString());
                obj.Value       = Convert.ToDecimal(row["Value"].ToString());
                obj.SupplierID  = Convert.ToInt32(row["SupplierID"].ToString());
            }
            catch (Exception ex)
            {
            }
            return(obj);
        }
示例#16
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);
        }
示例#17
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);
        }
示例#18
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);
        }
示例#19
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);
        }
示例#20
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
        }
示例#21
0
        private LINKPayment ConvertToObjectSupp(DataRow row)
        {
            LINKPayment obj = new LINKPayment();

            try
            {
                obj.SupplierCode = row["SupplierCode"].ToString();
                obj.SupName      = row["SupName"].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());
                obj.AccNo        = row["ACCNo"].ToString();
            }
            catch (Exception ex)
            { }
            return(obj);
        }
示例#22
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);
        }
示例#23
0
        public DataTable DALGetFinalSupplier(LINKPayment objPayment)
        {
            DataTable dt = new DataTable();

            try
            {
                SqlCommand oSqlCommand = new SqlCommand();
                string     SqlQuery    = "WCF_PaymentSupplier";

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

                dt           = new DALBase().SelectSPMRP(oSqlCommand);
                dt.TableName = "tblSupplier";
            }
            catch (Exception ex)
            { }
            return(dt);
        }
示例#24
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);
        }
示例#25
0
        public List <LINKPayment> BALGetFinalSupplier(LINKPayment objPayment)
        {
            List <LINKPayment> listobj = new List <LINKPayment>();
            DataTable          dt      = new DataTable();

            try
            {
                DALPayment objDALPayment = new DALPayment();
                dt = objDALPayment.DALGetFinalSupplier(objPayment);

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

            return(listobj);
        }
示例#26
0
        public List <LINKPayment> BALGetLastPayment(LINKPayment objPayment)
        {
            List <LINKPayment> listobj = new List <LINKPayment>();
            DataTable          dt      = new DataTable();

            try
            {
                DataAccessHandler.Voucher objDALPayment = new DataAccessHandler.Voucher();
                dt = objDALPayment.DALGetLastPayment(objPayment);

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

            return(listobj);
        }
示例#27
0
        public bool BALInsertInvoice(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.DALInsertInvoice(objPayment);

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

                            status = objDALPayment.DALInsertInvoiceFromGRN(objLink);

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

                    if (status)
                    {
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(status);
        }
示例#28
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);
        }
示例#29
0
 public bool SetMaterialStatus(LINKPayment objPayment)
 {
     return(objBALPayment.BALUpdateMaterial(objPayment));
 }
示例#30
0
 public List <LINKPayment> GetGRNMaterial(LINKPayment objPayment)
 {
     return(objBALPayment.BALGetGRNMaterial(objPayment));
 }