Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Datalayer.ShowQuestMsg("Are you sure? Do you want to Send SMS? "))
            {
                int iSend = 0, iNotSend = 0;

                for (int i = 0; i < dgDisplayData.Rows.Count; i++)
                {
                    if (Convert.ToString(dgDisplayData.Rows[i].Cells[0].Value) == "True")
                    {
                        string sMobileNo = dgDisplayData.Rows[i].Cells["MobileNo"].Value.ToString();
                        string sMSG      = dgDisplayData.Rows[i].Cells["Msg"].Value.ToString();
                        string SMSID     = dgDisplayData.Rows[i].Cells["SMSID"].Value.ToString();

                        int iD = 0;
                        int.TryParse(SMSID, out iD);
                        bool IsSend = SendSMS(sMobileNo, sMSG);
                        if (IsSend)
                        {
                            iSend = iSend + 1;
                        }
                        else
                        {
                            iNotSend = iNotSend + 1;
                        }

                        int?Iout = 0;
                        MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                        MyDa.USP_VP_ADDSMS(iD, DateTime.Now, sMobileNo, sMSG, IsSend, Datalayer.iT001_COMPANYID, ref Iout);
                    }
                }

                Datalayer.InformationMessageBox("SMS Send successfully.");
            }
        }
Example #2
0
 private void dgDisplayData_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
     {
         dgDisplayData.Rows.Remove(dgDisplayData.CurrentRow);
         PopautleGrandTotal();
     }
 }
Example #3
0
 private void dgDisplayData_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
         {
             dgDisplayData.Rows.Remove(dgDisplayData.CurrentRow);
         }
     }
 }
 private void dgDisplayData_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
         {
             dgDisplayData.Rows.Remove(dgDisplayData.CurrentRow);
             PopautleGrandTotal();
         }
     }
     if (e.KeyCode == Keys.Tab)
     {
         txtBillNo.Focus();
         dgDisplayData.ClearSelection();
     }
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (dgDisplayData.Rows.Count == 0)
            {
                Datalayer.InformationMessageBox("Please select customer ");
                return;
            }
            if (Datalayer.ShowQuestMsg("Are you sure? Do you want to Send SMS? "))
            {
                int iSend = 0, iNotSend = 0;

                for (int i = 0; i < dgDisplayData.Rows.Count; i++)
                {
                    if (Convert.ToString(dgDisplayData.Rows[i].Cells[0].Value) == "True")
                    {
                        string sMobileNo    = dgDisplayData.Rows[i].Cells["T001_MOBILE1"].Value.ToString();
                        string sName        = dgDisplayData.Rows[i].Cells["T001_NAME"].Value.ToString();
                        string sAmount      = dgDisplayData.Rows[i].Cells["TOTALPENDING"].Value.ToString();
                        string sCompanyName = dgDisplayData.Rows[i].Cells["TM_NAME"].Value.ToString();
                        string sPhoneNo     = dgDisplayData.Rows[i].Cells["TM_PHONENO"].Value.ToString();

                        string sMSG   = "Dear, " + sName + " your pending amount payable to " + sCompanyName + " is Rs." + sAmount + " and it is now overdue. Please Contact us on " + sPhoneNo + " urgently to discuss our policy.";
                        bool   IsSend = SendSMS(sMobileNo, sMSG);
                        if (IsSend)
                        {
                            iSend = iSend + 1;
                        }
                        else
                        {
                            iNotSend = iNotSend + 1;
                        }

                        int?Iout = 0;
                        MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                        MyDa.USP_VP_ADDSMS(0, DateTime.Now, sMobileNo, sMSG, IsSend, Datalayer.iT001_COMPANYID, ref Iout);
                    }
                }

                Datalayer.InformationMessageBox("SMS Send successfully.");
                lblTotalSend.Text = "Total Send SMS:" + iSend.ToString();
                lblNotSend.Text   = "Total Not Send SMS:" + iNotSend.ToString();
            }
        }
Example #6
0
        void DelelteData()
        {
            if (dgDisplayData.SelectedRows.Count > 0)
            {
                if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
                {
                    try
                    {
                        int ID = 0;
                        int.TryParse(dgDisplayData.CurrentRow.Cells["T007_SALEID"].Value.ToString(), out ID);

                        int?Iout = 0;
                        MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                        MyDa.USP_VP_DELETE_SALEITEM(ID, ref Iout);
                        MyDa.USP_VP_DELETE_SALE(ID, ref Iout);

                        if (Iout > 0)
                        {
                            Datalayer.DeleteMessageBox("Sale Details");
                            PopualteData();
                        }
                        else
                        {
                            Datalayer.DosenotDeleteMessageBox("Sale Details");
                        }
                    }
                    catch (Exception)
                    {
                        Datalayer.InformationMessageBox(Datalayer.sMessageForainKey);
                        return;
                    }
                }
            }
            else
            {
                Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection);
            }
        }
Example #7
0
        void DelelteData()
        {
            if (dgDisplayData.SelectedRows.Count > 0)
            {
                if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
                {
                    try
                    {
                        int ID = 0;
                        int.TryParse(dgDisplayData.CurrentRow.Cells["T010_PACKINGSLIPID"].Value.ToString(), out ID);

                        int?Iout = 0;
                        MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                        MyDa.USP_VP_DELETE_ALL_PACKINGSLIPORDER(ID, ref Iout);
                        string sQuery = "DELETE FROM T010_PACKINGSLIP WHERE T010_PACKINGSLIPID=" + ID;
                        DAL    dl     = new DAL();
                        if (dl.ExecuteMethod(sQuery))
                        {
                            Datalayer.DeleteMessageBox("Packing Slip Details");
                            PopualteData();
                        }
                        else
                        {
                            Datalayer.DosenotDeleteMessageBox("Packing Slip Details");
                        }
                    }
                    catch (Exception)
                    {
                        Datalayer.InformationMessageBox(Datalayer.sMessageForainKey);
                        return;
                    }
                }
            }
            else
            {
                Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection);
            }
        }
        void DelelteData()
        {
            if (dgDisplayData.SelectedRows.Count > 0)
            {
                if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation))
                {
                    try
                    {
                        int ID = 0;
                        int.TryParse(dgDisplayData.CurrentRow.Cells["T009_PAYMENTID"].Value.ToString(), out ID);

                        int?Iout = 0;
                        MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                        string Sq = "DELETE FROM T009_PAYMENT WHERE T009_PAYMENTID=" + ID;
                        DAL    dl = new DAL();
                        if (dl.ExecuteMethod(Sq))
                        {
                            PopualteData();
                        }
                        else
                        {
                            Datalayer.DosenotDeleteMessageBox("Payment Details");
                        }
                    }
                    catch (Exception)
                    {
                        Datalayer.InformationMessageBox(Datalayer.sMessageForainKey);
                        return;
                    }
                }
            }
            else
            {
                Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection);
            }
        }
Example #9
0
        void AddUpdatePackingSlip()
        {
            try
            {
                ep1.Clear();
                if (string.IsNullOrEmpty(cmbName.Text.Trim()))
                {
                    ep1.SetError(cmbName, "This field is required.");
                    cmbName.Focus();
                    return;
                }
                if (dgDisplayData.Rows.Count == 0)
                {
                    Datalayer.InformationMessageBox("Record is required..");
                }

                int T010_PACKINGSLIPID = Datalayer.T010_PACKINGSLIPID;

                // int TM01_CUSTOMERID = 0;
                string   T010_NO = "", T010_TRANSPORT = "", T010_LRNO = "";
                int      T001_ACCOUNTID = 0;
                DateTime T003_DATE      = dtpDate.Value;

                // int.TryParse(cmbCustomerName.SelectedValue.ToString(), out TM01_CUSTOMERID);
                T010_NO        = txtBillNo.Text.Trim();
                T010_TRANSPORT = txtTransport.Text.Trim();
                T010_LRNO      = txtLRNo.Text.Trim();
                int.TryParse(cmbName.SelectedValue.ToString(), out T001_ACCOUNTID);

                if (T010_PACKINGSLIPID > 0)
                {
                    int?iDeletePurchaseItem_out = 0;
                    MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                    MyDa.USP_VP_DELETE_ALL_PACKINGSLIPORDER(T010_PACKINGSLIPID, ref iDeletePurchaseItem_out);
                }

                int?T010_PACKINGSLIPID_out = 0;
                Cursor.Current = Cursors.WaitCursor;
                MyDa           = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                MyDa.USP_VP_ADDUPDATE_PACKING_SLIP(T010_PACKINGSLIPID, T001_ACCOUNTID, T010_NO, T003_DATE, T010_TRANSPORT, T010_LRNO, Datalayer.iT001_COMPANYID, ref T010_PACKINGSLIPID_out);
                if (T010_PACKINGSLIPID_out > 0)
                {
                    T010_PACKINGSLIPID = int.Parse(T010_PACKINGSLIPID_out.Value.ToString());
                    int? @T011_PACKINGSLIPORDERID_OUT = 0;
                    for (int i = 0; i < dgDisplayData.Rows.Count; i++)
                    {
                        if (!string.IsNullOrEmpty(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_ORDERID"].Value)))
                        {
                            int T004_ORDERID = 0, T011_QTY = 0;
                            int.TryParse(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_ORDERID"].Value), out T004_ORDERID);
                            int.TryParse(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_PENDING_QTY"].Value), out T011_QTY);

                            if (T011_QTY > 0)
                            {
                                int?T002_PURCHASEITEMID_Out = 0;
                                MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                                MyDa.USP_VP_ADDUPDATE_PACKINGSLIPORDER(0, T010_PACKINGSLIPID, T004_ORDERID, T011_QTY, Datalayer.iT001_COMPANYID, ref T002_PURCHASEITEMID_Out);
                            }
                        }
                    }

                    if (Datalayer.T010_PACKINGSLIPID == 0)
                    {
                        Datalayer.InsertMessageBox(sPageName);
                        ResteData();

                        if (Datalayer.ShowQuestMsg("are you sure do you want to print this bill ?"))
                        {
                            DAL       dl = new DAL();
                            DataTable dt = new DataTable();
                            dt = dl.SelectMethod("exec USP_VP_GET_PRINT_PACKING_SLIP_ONID '" + T010_PACKINGSLIPID + "'");
                            if (dt.Rows.Count > 0)
                            {
                                ReportDocument RptDoc = new ReportDocument();
                                RptDoc.Load(Application.StartupPath + @"\Report\rptPackingSlip.rpt");
                                RptDoc.SetDataSource(dt);

                                Datalayer.RptReport   = RptDoc;
                                Datalayer.sReportName = "Packing Slip Bill";

                                Report.frmReportViwer fmReport = new Report.frmReportViwer();
                                fmReport.Show();
                            }
                            else
                            {
                                Datalayer.InformationMessageBox("No Record..");
                            }
                        }

                        //DataTable dt = new DataTable();
                        //dt = dl.SelectMethod("exec USP_VP_GET_FULLSALEBILL '" + T003_SALEID + "'");
                        //if (dt.Rows.Count > 0)
                        //{
                        //    ReportDocument RptDoc = new ReportDocument();

                        //    RptDoc.Load(Application.StartupPath + @"\Report\rptRetailInvoice.rpt");
                        //    RptDoc.SetDataSource(dt);

                        //    Datalayer.RptReport = RptDoc;
                        //    Datalayer.sReportName = "Invoice";

                        //    frmReportViewer fmReport = new frmReportViewer();
                        //    fmReport.Show();
                        //}
                    }
                    else
                    {
                        Datalayer.UpdateMessageBox(sPageName);
                        this.Close();
                    }
                }
                else
                {
                    if (Datalayer.T010_PACKINGSLIPID == 0)
                    {
                        Datalayer.DosenotInsertMessageBox(sPageName);
                    }
                    else
                    {
                        Datalayer.DosenotUpdateMessageBox(sPageName);
                    }
                    return;
                }
            }
            catch (Exception ex)
            {
                Datalayer.WorningMessageBox(ex.Message.ToString(), "Error");
            }
        }