Esempio n. 1
0
        //Fill DDL Division , Region-Type , Region-Classification , User-Type , Expense-Header-Group
        #region Get ExpenseMapping Master Data
        public DataSet GetExpenseMappingMasterData()
        {
            DataSet ds = new DataSet();


            objData.OpenConnection(_ObjCurInfo.GetCompanyCode());
            {
                string StrSQL = "EXEC SP_hdGetExpenseMappingMasterData " + _ObjCurInfo.GetCompanyCode();
                ds = objData.ExecuteDataSet(StrSQL);
                objData.CloseConnection();
            }
            return(ds);
        }
Esempio n. 2
0
        public JsonResult GetTPHeader(string userCode)
        {
            if (userCode.ToUpper() == "MINE")
            {
                userCode = objCurr.GetUserCode();
            }

            DataSet dsTpHeader = new DataSet();

            objData.OpenConnection(objCurr.GetCompanyCode());
            {
                dsTpHeader = objData.ExecuteDataSet("exec SP_mhdGetTPReport '" + objCurr.GetCompanyCode() + "','" + userCode + "'");
            }
            objData.CloseConnection();
            DataControl.JSONConverter json = new DataControl.JSONConverter();
            return(Json(json.Serialize(dsTpHeader)));
        }
Esempio n. 3
0
        public DataSet GetAllExpense()
        {
            DataSet dssub = new DataSet();

            objData.OpenConnection(objCurrentInfo.GetCompanyCode());
            {
                string StrSQL = "EXEC SP_hd_ExpenseType_Select " + objCurrentInfo.GetCompanyCode();
                dssub = objData.ExecuteDataSet(StrSQL);
                objData.CloseConnection();
            }

            return(dssub);
        }
Esempio n. 4
0
        public double CalculateSFCFare(Models.FareCalculationDTO fareCalcPassed)
        {
            try
            {
                double totalFare = 0.0;
                string hopNeed   = fareCalcPassed.IntermediatePlace;
                string entity    = fareCalcPassed.Entity;
                string dcrCode   = fareCalcPassed.DcrCode;
                string dcrDate   = fareCalcPassed.DcrDate;
                string dcrFlag   = fareCalcPassed.DcrFalg;

                Controllers.MasterController objMaster = new Controllers.MasterController();
                DataControl.CurrentInfo      objCurr   = new DataControl.CurrentInfo();
                DataControl.Data             objData   = new DataControl.Data();

                string companyCode = objCurr.GetCompanyCode();
                string userCode    = objCurr.GetUserCode();
                string regionCode  = objCurr.GetRegionCode();

                if (entity == "HQ")
                {
                    DataSet dsHop = new DataSet();

                    objData.OpenConnection(companyCode);
                    {
                        dsHop = objData.ExecuteDataSet("exec SP_hdGetHopPlaces '" + companyCode + "','" + dcrCode + "','" + userCode + "','" + dcrDate + "','" + dcrFlag + "'");
                    }
                    objData.CloseConnection();

                    if (dsHop.Tables[0].Rows.Count > 0)
                    {
                        try
                        {
                            objData.OpenConnection(companyCode);
                            {
                                totalFare = Convert.ToDouble(objData.ExecuteScalar("exec SP_hdGetSFCAmount '" + companyCode + "','" + dsHop.Tables[0].Rows[0]["SFC_Region_Code"].ToString().Trim() + "','" + dsHop.Tables[0].Rows[0]["From_Place"].ToString().Trim() + "','" + dsHop.Tables[0].Rows[0]["To_Place"].ToString().Trim() + "','" + dsHop.Tables[0].Rows[0]["SFC_Category_Name"].ToString().Trim() + "','" + dsHop.Tables[0].Rows[0]["Travel_Mode"].ToString().Trim() + "','" + dcrDate + "','" + userCode + "','" + regionCode + "','" + entity + "'"));
                            }
                            objData.CloseConnection();
                        }
                        catch
                        {
                            totalFare = 0.0;
                        }
                    }
                }
                else
                {
                    DataSet dsTravelPlace  = new DataSet();
                    double  fareAmount     = 0.0;
                    double  travelDistance = 0.0;

                    dsTravelPlace = objMaster.GetTrvelPlace(companyCode, dcrCode, dcrFlag, userCode, dcrDate);

                    if (dsTravelPlace.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow dr in dsTravelPlace.Tables[0].Rows)
                        {
                            travelDistance = Convert.ToDouble(dr["Distance"].ToString().Trim());
                            try
                            {
                                objData.OpenConnection(companyCode);
                                {
                                    fareAmount = Convert.ToDouble(objData.ExecuteScalar("exec SP_hdGetSFCAmount '" + companyCode + "','" + dr["SFC_Region_Code"].ToString().Trim() + "','" + dr["From_Place"].ToString().Trim() + "','" + dr["To_Place"].ToString().Trim() + "','" + dr["SFC_Category_Name"].ToString().Trim() + "','" + dr["Travel_Mode"].ToString().Trim() + "','" + dcrDate + "','" + userCode + "','" + regionCode + "','" + entity + "'"));
                                }
                                objData.CloseConnection();
                            }
                            catch
                            {
                                fareAmount = 0.0;
                            }
                            totalFare += fareAmount;
                        }
                    }
                }
                return(totalFare);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        public string GetForgotpassword(FormCollection collection)
        {
            try
            {
                string userName = string.Empty;
                userName = collection["UserName"];
                string  result   = "";
                DataSet dsReport = new DataSet();
                DataControl.JSONConverter json = new DataControl.JSONConverter();

                try
                {
                    _objData.OpenConnection(_objcurrentInfo.GetCompanyCode());
                    dsReport = _objData.ExecuteDataSet("EXEC SP_HdGetCheckUsername " + "'" + _objcurrentInfo.GetCompanyCode() + "','" + userName + "'");
                }
                finally
                {
                    _objData.CloseConnection();
                }


                if (dsReport.Tables[0].Rows.Count != 0)
                {
                    string strEmailid  = dsReport.Tables[0].Rows[0]["Email_Id"].ToString();
                    string UserName    = dsReport.Tables[0].Rows[0]["User_Name"].ToString();
                    string strUserpass = dsReport.Tables[0].Rows[0]["User_Pass"].ToString();

                    if (!string.IsNullOrEmpty(strEmailid))
                    {
                        //string strSubject = "Dear Sir/Madam, \n\n Please keep a note of the following information which is critical for ensuring uninterrupted access to HiDOCTOR \n\n  Your User Id:  " + UserName + " \n  Your Password: "******" \n\n In case of any clarifications, please reach out to our support desk ([email protected] or 095600005628).\n\n Assuring you of our best services at all times.\n\n Warm Regards \n Customer Service ";
                        string  companyName  = "";
                        string  employeeName = "";
                        string  phoneNo      = "Not yet registered in HiDOCTOR";
                        string  mobileNo     = "Not yet registered in HiDOCTOR";
                        DataSet dsEmpInfo    = new DataSet();

                        try
                        {
                            _objData.OpenConnection(_objcurrentInfo.GetCompanyCode());
                            dsEmpInfo = _objData.ExecuteDataSet("EXEC SP_HdGetEmployeeDetail " + "'" + _objcurrentInfo.GetCompanyCode() + "','" + userName + "'");
                        }
                        finally
                        {
                            _objData.CloseConnection();
                        }

                        if (dsEmpInfo.Tables[0].Rows.Count > 0)
                        {
                            companyName  = dsEmpInfo.Tables[0].Rows[0]["Company_Name"].ToString().Trim();
                            employeeName = dsEmpInfo.Tables[0].Rows[0]["Employee_Name"].ToString().Trim();

                            if (dsEmpInfo.Tables[0].Rows[0]["Phone"].ToString().Trim().Length > 0)
                            {
                                phoneNo = dsEmpInfo.Tables[0].Rows[0]["Phone"].ToString().Trim();
                            }

                            if (dsEmpInfo.Tables[0].Rows[0]["Mobile"].ToString().Trim().Length > 0)
                            {
                                mobileNo = dsEmpInfo.Tables[0].Rows[0]["Mobile"].ToString().Trim();
                            }
                        }

                        string server   = ConfigurationManager.AppSettings["SMTPSERVER"];
                        string frommail = ConfigurationManager.AppSettings["FROMMAIL"];

                        string strSubject    = Resources.Password_Policy_Messages.PasswordLockReleaseMail.ToString();
                        string strSubjectNew = strSubject.Replace("@Name", UserName).Replace("@Pass", strUserpass);

                        strSubjectNew = strSubjectNew.Replace("@CompanyName", companyName);
                        strSubjectNew = strSubjectNew.Replace("@EmployeeName", employeeName);
                        strSubjectNew = strSubjectNew.Replace("@PhoneNo", phoneNo);
                        strSubjectNew = strSubjectNew.Replace("@MobileNo", mobileNo);

                        bool Issmtpmail = false;
                        Issmtpmail = _objSPData.SendMail(strEmailid, "Check your HiDOCTOR Password", strSubjectNew);
                        return("SUCCESS");
                    }
                    else
                    {
                        return("MAIL");
                    }
                }
                else
                {
                    return("FAILED");
                }
            }
            catch
            {
                return("FAILED");
            }
        }