Exemple #1
0
        public void PrintInsuranceSalesInvioce(string sinvno)
        {
            var bl = new SalesManger().GetSalesReport(sinvno);
            var rpt = new RptSalesInsurance();
            decimal compshare = 0;
            decimal patshare = 0;
            decimal netamt = 0;
            string _Cashier = string.Empty;
            string _Doctorname = string.Empty;
            string cmpname = Utils.Companyname;
            foreach (DsReports.SalesInvListRow dr in bl.Rows)
            {
                netamt = dr.NETAMT;
                patshare = dr.CARDDISC;
                compshare = dr.CUSTOMERFIXDISC;
                _Cashier = new BLUserinfo().GetUserinfoByUserid(dr.SALESMAN);
                if (dr.DOCTOR > 0)
                    _Doctorname = new BLUserinfo().GetUserinfoByUserid(dr.DOCTOR);
                if (dr.CUSTNAME.ToUpper().IndexOf("BUPA") != -1)
                {
                    cmpname = "Exceer";
                }
	
            }
            var amtaf = netamt * (compshare / 100);
            var psh = (netamt - amtaf) * (patshare / 100);
            rpt.compshare = amtaf.ToString("##.##");
            rpt.patshare = psh.ToString("N2");
            if (Utils.Company=="01")
                rpt.company = cmpname;
            else
                rpt.company = Utils.Companyname;
            rpt.doctorname = _Doctorname;
            rpt.DataSource = bl;
            try
            {
                rpt.Print();
            }
            catch (Exception ex)
            {
                var stri = ex.ToString();
            }
        }
Exemple #2
0
 private void txtLoginname_Validated(object sender, EventArgs e)
 {
     if (txtLoginname.EditValue != null)
     {
         var bl = new BLUserinfo();
         bl.GetUserinfoByUserName(txtLoginname.EditValue.ToString().ToUpper());
         if(bl.UserinfoRow!=null)
         {
             Empid = bl.UserinfoRow.USERID;
             DoView();
         }
     }
 }
Exemple #3
0
 void DoSave(int op)
 {
     if (!UserinfoHasErrors()) return;
     var dt = new DsMaster.USERINFODataTable();
     var dr = (DsMaster.USERINFORow) dt.NewRow();
     dr.USERID = Empid;
     dr.EMPNO = txtEmpno.EditValue.ToString().ToUpper();
     dr.USERNAME = txtLoginname.EditValue.ToString().ToUpper();
     dr.FULLNAME = txtFullname.EditValue.ToString();
     dr.PASSWORD = Functions.Base64Encode(txtPassword.EditValue.ToString());
     dr.USERTYPE = cmbRole.SelectedIndex;
     dr.PROFILEID = cmbProfile.EditValue == null ? 0:int.Parse(cmbProfile.EditValue.ToString());
     dr.ACTIVE = checkEdit1.Checked;
     var bl = new BLUserinfo();
     bl.UserinfoRow = dr;
     try
     {
         var ret = bl.DoSave();
         if (ret == "1")
         {
            //Empid = bl.Newuserid;
             XtraMessageBox.Show("Data Saved", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
             SetNavigation();
             DoNew();
         }
         if(op==1 && ret=="1")
          {
             Dispose();
          }
         //if (op == 1 && ret == "2")
         //{
         //   DoNew();
         //}
     }
     catch(Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "POS", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
     }
 }
Exemple #4
0
 private void txtEmpno_Validated(object sender, EventArgs e)
 {
     //dr.EMPNO = txtEmpno.EditValue.ToString().ToUpper();
     //dr.USERNAME = txtLoginname.EditValue.ToString().ToUpper();
     if (txtEmpno.EditValue != null)
     {
         var bl = new BLUserinfo();
         bl.GetUserinfoByEmp(txtEmpno.EditValue.ToString().ToUpper());
         if(bl.UserinfoRow!=null)
         {
             Empid = bl.UserinfoRow.USERID;
             DoView();
         }
     }
 }
Exemple #5
0
        void SetHeaderAndFooterData()
        {
            DataRow Hrow = ds.Rows[0];
            //DOCTOR
            //SALESMAN
             _Cashier = new BLUserinfo().GetUserinfoByUserid(int.Parse(Hrow["SALESMAN"].ToString()));
             if (int.Parse(Hrow["DOCTOR"].ToString()) > 0)
                 _Doctorname = new BLUserinfo().GetUserinfoByUserid(int.Parse(Hrow["DOCTOR"].ToString()));

                 _stype = Hrow["SALESTYPE"].ToString();
            if(string.IsNullOrEmpty(_stype))
                _stype = "R";
            if (_stype == "C")
            {
                 _CustomerName = Hrow["CUSTNAME"].ToString();
            }
            if (_stype == "I")
            {
                _FileNo = Hrow["CARDID"].ToString();
                _PolicyNo = Hrow["CARDNO"].ToString();
                _CardDisc = Hrow["CARDDISC"].ToString();
                _CustomerFixDisc = Hrow["CUSTOMERFIXDISC"].ToString();
                _Grade = Hrow["GRADE"].ToString();
                var sp = Hrow["CUSTNAME"].ToString().Split('-');
                _CustomerName = sp[0];
                 if (sp.Length > 1)
                 {
                     _Patientname = sp[1];
                 }
             }
            if(_tot=="0")
                _tot = Hrow["TOTALAMT"].ToString();
            if (_disc == "0")
              _disc = string.IsNullOrEmpty(Hrow["SDISC"].ToString()) ? "0" : Hrow["SDISC"].ToString();
            if (_NetAmount == "0")
             _NetAmount = Hrow["NETAMT"].ToString();
            if (_ReturnAmt == "0")
               _ReturnAmt = Hrow["RETURNAMT"].ToString();
            if (string.IsNullOrEmpty(_ReturnAmt))
                _ReturnAmt = "0";
        }