Exemplo n.º 1
0
        private void btnNewSummary_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure to start new summary (RSS)? Return Date : " + DateTime.Now.ToString(), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dr == DialogResult.Yes)
            {
                if (cmbGroup.Text != "" && cmbReturnType.Text != "")
                {
                    string Rssid = ObjbllSaleReturn.Maxid();
                    if (ObjbllSaleReturn.SaveRss(Convert.ToDateTime(GlobalVar.g_WorkDate), ObjbllSaleReturn.ReturnGroupId(cmbGroup.Text), cmbReturnType.Text, GlobalVar.g_UserID,Rssid))
                    {

                        bool IsOpen = false;
                        foreach (Form f in Application.OpenForms)
                        {
                            if (f.Name == "frmSaleReturn")
                            {
                                IsOpen = true;
                                f.Focus();
                                break;
                            }
                        }
                        if (IsOpen == false)
                        {
                            if (cmbGroup.Text != "")
                            {
                                dtReturnSummarySecurity = ObjbllUserSecurity.AllFormSecurity(GlobalVar.Type, GlobalVar.Category, Name);
                                if (Convert.ToBoolean(dtReturnSummarySecurity.Rows[0]["CanView"]))
                                {
                                    frmSaleReturn frm = new frmSaleReturn(cmbGroup.Text, dtReturnSummarySecurity, cmbReturnType.Text, Rssid, "New Summary");
                                    frm.WindowState = FormWindowState.Normal;
                                    frm.Show();
                                }
                                else
                                {
                                    MessageBox.Show("You are not authorized to view this form","ERP - Babar Medicine Company Lahore",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
                                }
                            }
                            else
                            {
                                MessageBox.Show("Please select group ", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Rss not open !!", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("Please select Group and Return Type!!", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
Exemplo n.º 2
0
 private void PicklistRSS()
 {
     Obj_mdlPickList.WhereClause = null;
     frmPickList pickList = new frmPickList(Obj_mdlPickList);
     Obj_mdlPickList.PickListID = "RSS";
     Obj_mdlPickList.ReturnFieldName = "RSS Id";
     Obj_mdlPickList.WhereClause = "UserId = " + GlobalVar.g_UserID + ",InvoiceMode = "+ cmbReturnType.Text;
     GlobalVar.g_pickListMultiSelection = false;
     pickList.ShowDialog();
     if (Obj_mdlPickList.ReturnFieldValue != null)
     {
         bool IsOpen = false;
         foreach (Form f in Application.OpenForms)
         {
             if (f.Name == "frmSaleReturn")
             {
                 IsOpen = true;
                 f.Focus();
                 break;
             }
         }
         if (IsOpen == false)
         {
             if (cmbReturnType.Text != "")
             {
                 dtReturnSummarySecurity = ObjbllUserSecurity.AllFormSecurity(GlobalVar.Type, GlobalVar.Category, Name);
                 if (Convert.ToBoolean(dtReturnSummarySecurity.Rows[0]["CanView"]))
                 {
                     frmSaleReturn frm = new frmSaleReturn(cmbGroup.Text, dtReturnSummarySecurity, cmbReturnType.Text, Obj_mdlPickList.ReturnFieldValue, "Load Summary");
                     frm.WindowState = FormWindowState.Normal;
                     frm.Show();
                 }
                 else
                 {
                     MessageBox.Show("You are not authorized to view this form", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
             }
             else
             {
                 MessageBox.Show("Please select group ", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }