Exemple #1
0
        /// <summary>
        /// Get under Usertype Name
        /// </summary>
        /// <returns></returns>
        public JsonResult GetUserType()
        {
            DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo();
            DataControl.BLMaster    _objBlmaster    = new DataControl.BLMaster();
            DivisionUserProducts    objDroUserType  = new DivisionUserProducts();

            objDroUserType.Company_Code = _objcurrentInfo.GetCompanyCode();
            // objDroUserType.User_Code = _objcurrentInfo.GetUserCode();
            try
            {
                IEnumerable <DivisionUserProducts> lstUsertype = _objBlmaster.GetUserTypeNames(objDroUserType);
                var userTypelist = (from userType in lstUsertype.AsEnumerable()
                                    select new DivisionUserProducts()
                {
                    User_Type_Code = userType.User_Type_Code.ToString(),
                    User_Type_Name = userType.User_Type_Name.ToString()
                }).ToList <DivisionUserProducts>();
                return(Json(userTypelist));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:companyCode", objDroUserType.Company_Code);
                dicContext.Add("Filter:userCode", objDroUserType.User_Code);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(Json("Sorry an error occured. Please try again later."));
            }
        }
Exemple #2
0
 public string InsertSplashUsers(int splashId, string Splashtype, string users, int isAssignToAll, string mode)
 {
     try
     {
         _objBLSplashScreen = new BL_SplashScreen();
         DataControl.CurrentInfo           objCurInfo     = new DataControl.CurrentInfo();
         List <MVCModels.SplashUsersModel> lstSplashUsers = new List <SplashUsersModel>();
         DataControl.BLUser objUser = new DataControl.BLUser();
         List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>();
         lstUser = objUser.GetChildUsers(objCurInfo.GetCompanyCode(), objCurInfo.GetUserCode());
         if (isAssignToAll == 1)
         {
             foreach (MVCModels.HiDoctor_Master.UserModel user in lstUser)
             {
                 MVCModels.SplashUsersModel objSUsers = new SplashUsersModel();
                 objSUsers.User_Id          = Convert.ToInt32(user.User_Id);
                 objSUsers.Company_Code     = objCurInfo.GetCompanyCode();
                 objSUsers.Splash_Screen_Id = splashId;
                 lstSplashUsers.Add(objSUsers);
             }
         }
         else
         {
             string[] ar = users.Split(',');
             foreach (string strUser in ar)
             {
                 MVCModels.SplashUsersModel objSUsers = new SplashUsersModel();
                 List <MVCModels.HiDoctor_Master.UserModel> lstDistict = lstUser.AsEnumerable().Where(x => x.User_Code == strUser).ToList();
                 objSUsers.User_Id          = Convert.ToInt32(lstDistict[0].User_Id);
                 objSUsers.Company_Code     = objCurInfo.GetCompanyCode();
                 objSUsers.Splash_Screen_Id = splashId;
                 lstSplashUsers.Add(objSUsers);
             }
         }
         int rowsAffected = 0;
         //if (mode == "A")
         //{
         //    List<MVCModels.HiDoctor_Master.UserModel> lstUsersMapped = new List<MVCModels.HiDoctor_Master.UserModel>();
         //    lstUsersMapped = _objBLSplashScreen.GetSplashMappedUsers(objCurInfo.GetCompanyCode(), splashId).ToList();
         //    List<MVCModels.SplashUsersModel> lst = lstSplashUsers.Where(s => !lstUsersMapped.Where(e => Convert.ToString(e.User_Id) == Convert.ToString(s.User_Id)).Any()).ToList();
         //    rowsAffected = _objBLSplashScreen.InsertSplashUsers(lst, splashId, objCurInfo.GetCompanyCode(), mode);
         //}
         //else
         //{
         rowsAffected = _objBLSplashScreen.InsertSplashUsers(lstSplashUsers, splashId, Splashtype, objCurInfo.GetCompanyCode(), mode);
         // }
         if (rowsAffected > 0)
         {
             return("SUCCESS");
         }
         else
         {
             return("ERROR");
         }
     }
     catch (Exception ex)
     {
         return("ERROR");
     }
 }
Exemple #3
0
        public JsonResult Getrequest()
        {
            DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo();
            DataControl.BLMaster    _objBlmaster    = new DataControl.BLMaster();
            RequestModel            objDroRequest   = new RequestModel();

            objDroRequest.Company_Code = _objcurrentInfo.GetCompanyCode();
            try
            {
                IEnumerable <RequestModel> lstRequest = _objBlmaster.GetRequest(objDroRequest);

                var requestlist = (from request in lstRequest.AsEnumerable()
                                   select new RequestModel()
                {
                    Request_Code = request.Request_Code.ToString(),
                    Request_Name = request.Request_Name.ToString()
                }).ToList <RequestModel>();
                return(Json(requestlist));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:companyCode", objDroRequest.Company_Code);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(Json("Sorry an error occured. Please try again later."));
            }
        }
Exemple #4
0
 public LargeJsonResult GetSplashMappedUsers(int splashId)
 {
     try
     {
         DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
         string userCode    = string.Empty;
         string companyCode = string.Empty;
         userCode    = objCurInfo.GetUserCode();
         companyCode = objCurInfo.GetCompanyCode();
         List <MVCModels.HiDoctor_Master.UserModel> lstUT = new List <MVCModels.HiDoctor_Master.UserModel>();
         lstUT = _objBLSplashScreen.GetSplashMappedUsers(companyCode, splashId).ToList();
         //  return Json(lstUT, JsonRequestBehavior.AllowGet);
         return(new LargeJsonResult
         {
             MaxJsonLength = Int32.MaxValue,
             JsonRequestBehavior = JsonRequestBehavior.AllowGet,
             Data = new
             {
                 lstUT
             }
         });
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #5
0
        public JsonResult GetNoticeBoardIsRead()
        {
            DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
            string companyCode             = objCur.GetCompanyCode();
            string userCode = objCur.GetUserCode();

            try
            {
                StringBuilder sbTableContent = new StringBuilder();
                DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard _objBlActivity = new DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard();
                DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();
                IEnumerable <MVCModels.NoticeBoardContentModel> lstdata = null;
                lstdata = _objBlActivity.GetNoticeBoarddetail(companyCode, userCode);
                return(Json(lstdata, JsonRequestBehavior.AllowGet));
            }


            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CompanyCode", companyCode);
                dicContext.Add("Filter:UserCode", userCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw new Exception("Sorry an error occurred. Please try again later");

                throw ex;
            }
        }
Exemple #6
0
        public double CalculateSFCFare(Models.FareCalculationDTO fareCalcPassed, double distance, string travelmode, string entity, string sumDistance)
        {
            double totalFare = 0.0;

            DataControl.BL_DCRStockiestExpense objExp  = new DataControl.BL_DCRStockiestExpense();
            DataControl.CurrentInfo            objCurr = new DataControl.CurrentInfo();
            DataSet dsDistanceMatrix = new DataSet();

            string companyCode  = objCurr.GetCompanyCode();
            string userTypeCode = objCurr.GetUserTypeCode();
            double fromKm       = 0.0;
            double toKm         = 0.0;
            double fare         = 0.0;
            double total        = 0.0;
            int    j            = 0;

            dsDistanceMatrix = objExp.GetDistanceMatrixForFareCalculation(companyCode, userTypeCode, fareCalcPassed.Entity, travelmode, fareCalcPassed.DcrDate);
            if (dsDistanceMatrix.Tables[0].Rows.Count > 0)
            {
                for (int index = 0; index < dsDistanceMatrix.Tables[0].Rows.Count; index++)
                {
                    fromKm = Convert.ToDouble(dsDistanceMatrix.Tables[0].Rows[index]["From_Km"].ToString().Trim());
                    toKm   = Convert.ToDouble(dsDistanceMatrix.Tables[0].Rows[index]["To_Km"].ToString().Trim());

                    if (distance >= fromKm && distance <= toKm)
                    {
                        fare       = Convert.ToDouble(dsDistanceMatrix.Tables[0].Rows[index]["Fare_Amount"].ToString().Trim());
                        total      = distance * fare;
                        totalFare += total;
                    }
                }
            }

            return(totalFare);
        }
Exemple #7
0
        public bool CheckSfcMasterExist()
        {
            try
            {
                bool flag = false;
                DataControl.CurrentInfo objCurr = new DataControl.CurrentInfo();
                DataControl.Data        objData = new DataControl.Data();
                string companyCode = objCurr.GetCompanyCode();
                string regionCode  = objCurr.GetRegionCode();
                int    result      = 0;

                objData.OpenConnection(companyCode);
                {
                    result = Convert.ToInt32(objData.ExecuteScalar("exec SP_hdCheckSfcMasterExist '" + companyCode + "','" + regionCode + "'"));
                }
                objData.CloseConnection();

                if (result > 0)
                {
                    flag = true;
                }
                return(flag);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #8
0
        public JsonResult GetUserCodesForTree(int Group_Id)
        {
            DataControl.CurrentInfo       objCurInfo   = new DataControl.CurrentInfo();
            List <MVCModels.UserCodeTree> lstTreeMembs = new List <MVCModels.UserCodeTree>();

            lstTreeMembs = _ObjNoticeBoard.GetUserCodesForTree(Group_Id);
            return(Json(lstTreeMembs, JsonRequestBehavior.AllowGet));
        }
Exemple #9
0
 public int SaveFormValue(MVCModels.Form_Value objFormValue)
 {
     objFormControls           = new BL_FormControls();
     objCurInfo                = new DataControl.CurrentInfo();
     objFormValue.Company_Code = objCurInfo.GetCompanyCode();
     objFormValue.Company_Id   = Convert.ToInt32(objCurInfo.GetCompanyId());
     objFormValue.Created_By   = objCurInfo.GetUserCode();
     return(objFormControls.SaveFormValue(objFormValue));
 }
Exemple #10
0
        public int UpdateGroupStatus(int Group_Id, int Status)
        {
            int            result         = 0;
            BL_NoticeBoard ObjGroupStatus = new BL_NoticeBoard();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            result = ObjGroupStatus.UpdateGroupStatus(Group_Id, Status);
            return(result);
        }
Exemple #11
0
        public JsonResult GetGroupmembers(int Group_Id)
        {
            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string           RegionCode        = objCurInfo.GetRegionCode();
            UserGroupHistory lstGrpMembs       = new UserGroupHistory();

            lstGrpMembs = _ObjNoticeBoard.GetGroupmembers(Group_Id, RegionCode);
            return(Json(lstGrpMembs, JsonRequestBehavior.AllowGet));
        }
Exemple #12
0
        public string GetAllNoticesReadPopup(string mesgCode)
        {
            DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
            string companyCode             = objCur.GetCompanyCode();
            string userCode = objCur.GetUserCode();

            try
            {
                StringBuilder sbTableContent = new StringBuilder();
                DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard _objBlActivity = new DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard();
                DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();
                IEnumerable <MVCModels.NoticeBoardContentModel> lstdata = null;
                lstdata = _objBlActivity.GetNoticeBoardPopup(companyCode, mesgCode, userCode);
                sbTableContent.Append("</div>");
                sbTableContent.Append("<table id='NoticeBoardpopup' class='table table-striped' style='width:100%;'>");
                DataControl.Repository.AzureBlobUpload objAzureUpload = new DataControl.Repository.AzureBlobUpload();
                DataControl.Abstraction.IFileProvider  objPathProv    = new DataControl.Impl.FileSystemProvider();
                string accKey = objPathProv.GetConfigValue("NBFILES");
                //   string blobURL = objAzureUpload.AzureblockDownload(postedFile.FileName, accKey, containerName);

                foreach (var item in lstdata)
                {
                    sbTableContent.Append("<thead class='active'>");
                    sbTableContent.Append("<tr><td>NoticeBoardInfo</td><td></td></tr>");
                    sbTableContent.Append("</thead>");
                    sbTableContent.Append("<tr><td>Author</td>");
                    sbTableContent.Append("<td>" + item.Employee_Name + "(" + item.Author + ")</td></tr>");
                    sbTableContent.Append("<tr><td>Title</td>");
                    sbTableContent.Append("<td>" + item.Title + "</td></tr>");
                    sbTableContent.Append("<tr><td>Message</td>");
                    sbTableContent.Append("<td>" + item.Message + "</td></tr>");
                    sbTableContent.Append("<tr><td>Hyperlink</td>");
                    sbTableContent.Append("<td class='td-a'><a style='text-decoration:underline;cursor:pointer;' target='_blank' href='" + item.Hyperlink + "'>" + item.Hyperlink + "</a></td></tr>");
                    sbTableContent.Append("<tr><td>Attachments</td>");
                    string blobURL = accKey + Session["Comp_Code"].ToString().ToLower() + "/" + HttpUtility.UrlEncode(item.FilePath).ToString();
                    if (item.FilePath != "")
                    {
                        sbTableContent.Append("<td <div id='dvURL' class='div-alert'>Click on link to download : <a href=" + blobURL + " target='_blank' >" + item.FilePath + "</a></div></td></tr>");
                    }
                    else
                    {
                        sbTableContent.Append("<td></td></tr>");
                    }
                }
                return(sbTableContent.ToString());
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CompanyCode", companyCode);
                dicContext.Add("Filter:UserCode", userCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw new Exception("Sorry an error occurred. Please try again later");

                throw ex;
            }
        }
Exemple #13
0
        public JsonResult GetGroupNames()
        {
            List <MVCModels.UserGroup> lstGroups = new List <MVCModels.UserGroup>();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string RegionCode = objCurInfo.GetRegionCode();

            lstGroups = _ObjNoticeBoard.GetGroupNames(RegionCode);
            return(Json(lstGroups, JsonRequestBehavior.AllowGet));
        }
Exemple #14
0
        public string GetAllNoticeMandatoryDetail()
        {
            DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
            string companyCode             = objCur.GetCompanyCode();
            string userCode = objCur.GetUserCode();

            try
            {
                StringBuilder sbTableContent = new StringBuilder();
                DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard _objBlActivity = new DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard();
                DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();
                IEnumerable <MVCModels.NoticeBoardContentModel> lstdata = null;
                lstdata = _objBlActivity.GetNoticeBoarddetail(companyCode, userCode);
                sbTableContent.Append("</div>");
                sbTableContent.Append("<table id='NoticeBoardRead' class='table table-striped' style='width:100% !important;padding:4px !important;'>");
                sbTableContent.Append("<thead class='active'>");
                sbTableContent.Append("<tr><td>Title</td>");
                sbTableContent.Append("<td>ActiveFrom</td>");
                sbTableContent.Append("<td>ActiveTo</td>");
                sbTableContent.Append("<td>Author</td>");
                sbTableContent.Append("<td>IsRead</td></tr>");
                sbTableContent.Append("</thead>");
                if (lstdata.ToList().Count > 0)
                {
                    foreach (var item in lstdata)
                    {
                        if (item.Is_Read.ToString() == "No")
                        {
                            sbTableContent.Append("<tr style='font-weight:bold;font-style:italic;color:rgb(52, 172, 52)'><td><span   onclick=\"GetNoticepopup('" + item.Msg_Code + "')\" style='text-decoration:underline;cursor:pointer'>" + item.Title + "</span></td>");
                            sbTableContent.Append("<td>" + item.Active_From + "</td>");
                            sbTableContent.Append("<td>" + item.Active_To + "</td>");
                            sbTableContent.Append("<td>" + item.Employee_Name + "(" + item.Author + ")</td>");
                            sbTableContent.Append("<td>" + item.Is_Read + "</td></tr>");
                        }
                    }
                }
                else
                {
                    sbTableContent.Append("No records found");
                }
                return(sbTableContent.ToString());
            }


            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CompanyCode", companyCode);
                dicContext.Add("Filter:UserCode", userCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw new Exception("Sorry an error occurred. Please try again later");

                throw ex;
            }
        }
Exemple #15
0
        public int UpdateGroupDetails(string UserCodes, string GroupName, int Group_Id)
        {
            int            result      = 0;
            BL_NoticeBoard ObjGroupDet = new BL_NoticeBoard();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string UserName = objCurInfo.GetUserName();

            result = ObjGroupDet.UpdateGroupDetails(UserCodes, GroupName, Group_Id, UserName);
            return(result);
        }
Exemple #16
0
        public JsonResult GetPriceGroupMappedCustomers(string regionCode, string entity)
        {
            StringBuilder strContent = new StringBuilder();

            DataControl.BL_Customer objCutomer = new DataControl.BL_Customer();
            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            List <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = new
                                                                       List <MVCModels.HiDoctor_Master.DoctorModel>(objCutomer.GetCustomersByRegionAndEntity(objCurInfo.GetCompanyCode(), regionCode, entity));

            return(Json(_objJson.Serialize(lstCustomer)));
        }
Exemple #17
0
        public int InsertNewGroup(string UserCodes, string GroupName)
        {
            int result = 0;

            BL_NoticeBoard ObjNewGroup = new BL_NoticeBoard();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string UserName   = objCurInfo.GetUserName();
            string RegionCode = objCurInfo.GetRegionCode();

            result = ObjNewGroup.InsertNewGroup(UserCodes, GroupName, UserName, RegionCode);
            return(result);
        }
Exemple #18
0
        public string GetCustomersByRegionAndEntity(string regionCode, string entity, string priceGroupCode)
        {
            StringBuilder strContent = new StringBuilder();

            DataControl.BL_Customer objCutomer = new DataControl.BL_Customer();
            IEnumerable <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = null;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();

            List <MVCModels.HiDoctor_Master.DoctorModel> lstCustPriceGroup = new
                                                                             List <MVCModels.HiDoctor_Master.DoctorModel>(objCutomer.GetCustomersByPriceGroupCode(objCurInfo.GetCompanyCode(), regionCode,
                                                                                                                                                                  priceGroupCode, entity));

            lstCustomer = objCutomer.GetCustomersByRegionAndEntity(objCurInfo.GetCompanyCode(), regionCode, entity);
            strContent.Append("<table class='table table-striped' id='tblCustomer'><thead><tr><td>S.No</td>");
            strContent.Append("<td><input type='checkbox' name='chkSelectAllCustomer' onclick='fnSelectAllCustomers();'/></td>");
            strContent.Append("<td>Customer Name</td></tr></thead>");
            int i = 0;

            if (lstCustomer != null)
            {
                foreach (var dr in lstCustomer)
                {
                    i++;
                    strContent.Append("<tr><td>" + i + "</td>");
                    if (lstCustPriceGroup != null)
                    {
                        var filterd = lstCustPriceGroup.AsEnumerable().Where(z => z.Customer_Code == dr.Customer_Code.ToString()).ToList();
                        if (filterd.Count > 0)
                        {
                            strContent.Append("<td><input type='checkbox' checked='checked' id='chkSelect_"
                                              + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>");
                        }
                        else
                        {
                            strContent.Append("<td><input type='checkbox' id='chkSelect_" + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>");
                        }
                    }
                    else
                    {
                        strContent.Append("<td><input type='checkbox' id='chkSelect_" + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>");
                    }
                    strContent.Append("<td>" + dr.Customer_Name + "</td>");
                    strContent.Append("</tr>");
                }
                strContent.Append("</table>");
            }
            return(strContent.ToString());
        }
Exemple #19
0
        public string ExpenseInsert(string storedProcedure, string expensetypeCode, string companyCode, string expensetypeName, string expensetypeStatus, string expenseMode,
                                    string Period, string Mode, string displayOrder)
        {
            try
            {
                DataControl.CurrentInfo objCurentInfo = new DataControl.CurrentInfo();
                //string conStr = objData.GetConnectionString(objCurentInfo.GetCompanyCode());
                //con.ConnectionString = conStr;

                DataControl.Data db = new DataControl.Data();


                // Command - specify as StoredProcedure
                SqlCommand command = new SqlCommand(storedProcedure, con);
                command.CommandType = CommandType.StoredProcedure;

                AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode);
                AddParamToSqlCommand(command, "@Expense_Type_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, expensetypeCode);
                AddParamToSqlCommand(command, "@Expense_Type_Name", ParameterDirection.Input, SqlDbType.VarChar, 50, expensetypeName);
                AddParamToSqlCommand(command, "@Expense_Type_Status", ParameterDirection.Input, SqlDbType.VarChar, 30, expensetypeStatus);
                AddParamToSqlCommand(command, "@Expense_Mode", ParameterDirection.Input, SqlDbType.VarChar, 30, expenseMode);
                AddParamToSqlCommand(command, "@Expense_Period", ParameterDirection.Input, SqlDbType.VarChar, 30, Period);
                AddParamToSqlCommand(command, "@Mode", ParameterDirection.Input, SqlDbType.VarChar, 30, Mode);
                AddParamToSqlCommand(command, "@DisplayOrder", ParameterDirection.Input, SqlDbType.VarChar, 30, displayOrder);


                // Return value as parameter
                SqlParameter returnValue = new SqlParameter("@Result", SqlDbType.VarChar);
                returnValue.Direction = ParameterDirection.Output;
                returnValue.Size      = 500;
                command.Parameters.Add(returnValue);

                if (db.OpenConnection(objCurentInfo.GetCompanyCode()))
                {
                    // Execute the stored procedure
                    db.ExecuteNonQuery(command);
                    db.CloseConnection();
                }

                //For Handle the Error

                return(returnValue.Value.ToString());
            }
            catch (Exception ex)
            {
                ErrorLog.LogError(ex, "ExpenseInsert()");
                return("ERROR");
            }
        }
Exemple #20
0
        //fill grid

        public string GetRequestmapValues()
        {
            DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo();
            string companyCode = _objCurInfo.GetCompanyCode();

            try
            {
                DataControl.JSONConverter json           = new DataControl.JSONConverter();
                List <RequestModel>       lstRequestMap  = new List <RequestModel>();
                DataControl.BLMaster      _objMapping    = new DataControl.BLMaster();
                StringBuilder             sbTableContent = new StringBuilder();
                lstRequestMap = (List <RequestModel>)_objMapping.GetRequestMapDetails(companyCode);
                if (lstRequestMap != null && lstRequestMap.Count > 0)
                {
                    sbTableContent.Append("<table id='tblrequest' class='table table-striped' >");
                    sbTableContent.Append("<thead class='active'>");
                    sbTableContent.Append("<tr style='background-color: #428bca'>");
                    sbTableContent.Append("<td>Edit</td>");
                    sbTableContent.Append("<td>Change Status</td>");
                    sbTableContent.Append("<td>Request</td>");
                    sbTableContent.Append("<td>UserType</td>");
                    sbTableContent.Append("<td>Status</td>");
                    sbTableContent.Append("</tr>");
                    sbTableContent.Append("</thead>");
                    sbTableContent.Append("<tbody>");
                    int i = 0;
                    foreach (var item in lstRequestMap)
                    {
                        i++;
                        sbTableContent.Append("<tr><td><a href='#' onclick ='fnEdit(\"" + item.Request_Code.ToString() + "_" + item.User_Type_Code.ToString() + "_" + item.Request_Mapping_Code.ToString() + "\");'>Edit</a></td>");
                        sbTableContent.Append("<td><a href='#' onclick ='fnStatusChange(\"" + item.Request_Mapping_Code.ToString() + "_" + item.Record_Status.ToString() + "\");'>Change Status</a></td>");
                        sbTableContent.Append("<td>" + item.Request_Name.ToString() + "</td>");
                        sbTableContent.Append("<td>" + item.User_Type_Name.ToString() + "</td>");
                        sbTableContent.Append("<td>" + item.Status.ToString() + "</td></tr>");
                    }
                }
                sbTableContent.Append("</tbody>");
                sbTableContent.Append("</table>");

                return(sbTableContent.ToString() + "*" + json.Serialize(lstRequestMap));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:companyCode", companyCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return("Sorry an error occured. Please try again later.");
            }
        }
Exemple #21
0
 public JsonResult GetGroupDetails()
 {
     try
     {
         DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
         string UserName = objCurInfo.GetUserName();
         List <MVCModels.HiDoctor_Master.GroupDetails> lstGroup = new List <MVCModels.HiDoctor_Master.GroupDetails>();
         lstGroup = _objBLSplashScreen.GetGroupDetails(UserName).ToList();
         return(Json(lstGroup, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #22
0
        public string UploadAttachment(FormCollection coll)
        {
            try
            {
                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
                DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
                string companyCode             = objCur.GetCompanyCode();
                string newFilename             = string.Empty;
                var    container = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(
                    ConfigurationManager.AppSettings["NBBLOBACCKEY"]).CreateCloudBlobClient()
                                   .GetContainerReference(companyCode.ToLower());
                container.CreateIfNotExists();

                int    blocksCount = int.Parse(coll["blocksCount"].ToString());
                string fileName    = coll["fileName"].ToString();
                fileName    = fileName.Substring(fileName.LastIndexOf("\\") + 1);
                newFilename = fileName;
                string fileExtenstion = fileName.Substring(fileName.LastIndexOf("."));
                long   fileSize       = long.Parse(coll["fileSize"].ToString());
                newFilename = newFilename.Substring(0, newFilename.LastIndexOf('.'));
                newFilename = newFilename.ToString().Trim().Replace(" ", "_");

                fileName = newFilename + "_" + objCur.GetUserName() + "_" + DateTime.Now.ToString("ddMMyyyyHHmmssfff") + fileExtenstion;

                var fileToUpload = new MVCModels.CloudFile()
                {
                    BlockCount          = blocksCount,
                    FileName            = fileName,
                    Size                = fileSize,
                    BlockBlob           = container.GetBlockBlobReference(fileName),
                    StartTime           = DateTime.Now,
                    IsUploadCompleted   = false,
                    UploadStatusMessage = string.Empty
                };
                Session.Add("CurrentFile", fileToUpload);
                return(fileName);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();

                dicContext.Add("Method:", MethodBase.GetCurrentMethod().Name);

                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);

                throw ex;
            }
        }
Exemple #23
0
 public JsonResult GetselectedGroupCodes(string GroupCodes)
 {
     try
     {
         DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
         string companyCode = string.Empty;
         companyCode = objCurInfo.GetCompanyCode();
         List <MVCModels.HiDoctor_Master.GroupDetails> lstGroupCode = new List <MVCModels.HiDoctor_Master.GroupDetails>();
         lstGroupCode = _objBLSplashScreen.GetselectedGroupCodes(companyCode, GroupCodes).ToList();
         return(Json(lstGroupCode, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #24
0
        public string Inward(string storedProcedure, string companyCode, string UserCode, string ProductCode, string InwardDate, string Inwardstock, string UserInwardCode, string UserInwarddetails, string CurrentStock)
        {
            try
            {
                DataControl.CurrentInfo objCurentInfo = new DataControl.CurrentInfo();
                //string conStr = objData.GetConnectionString(objCurentInfo.GetCompanyCode());
                //con.ConnectionString = conStr;

                DataControl.Data db = new DataControl.Data();


                // Command - specify as StoredProcedure
                SqlCommand command = new SqlCommand(storedProcedure, con);
                command.CommandType = CommandType.StoredProcedure;

                AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode);
                AddParamToSqlCommand(command, "@User_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, UserCode);
                AddParamToSqlCommand(command, "@Product_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, ProductCode);
                AddParamToSqlCommand(command, "@Inward_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, InwardDate);
                AddParamToSqlCommand(command, "@Inward_stock", ParameterDirection.Input, SqlDbType.VarChar, 30, Inwardstock);
                AddParamToSqlCommand(command, "@User_Inward_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, UserInwardCode);
                AddParamToSqlCommand(command, "@User_Inward_Detail", ParameterDirection.Input, SqlDbType.VarChar, 30, UserInwarddetails);
                AddParamToSqlCommand(command, "@Current_Stock", ParameterDirection.Input, SqlDbType.VarChar, 30, CurrentStock);
                // Return value as parameter
                SqlParameter returnValue = new SqlParameter("@Result", SqlDbType.VarChar);
                returnValue.Direction = ParameterDirection.Output;
                returnValue.Size      = 500;
                command.Parameters.Add(returnValue);

                if (db.OpenConnection(objCurentInfo.GetCompanyCode()))
                {
                    // Execute the stored procedure
                    db.ExecuteNonQuery(command);
                    db.CloseConnection();
                }

                //For Handle the Error

                return(returnValue.Value.ToString());
            }
            catch (Exception ex)
            {
                ErrorLog.LogError(ex, "Inward()");
                return("ERROR");
            }
        }
Exemple #25
0
        public string productInsert(string storedProcedure, string companyCode, string salesproductCode, string mappingproductCode, string effectiveFrom, string createdDate, string createdBy, string recordStatus)
        {
            try
            {
                DataControl.CurrentInfo objCurentInfo = new DataControl.CurrentInfo();
                //string conStr = objData.GetConnectionString(objCurentInfo.GetCompanyCode());
                //con.ConnectionString = conStr;

                DataControl.Data db = new DataControl.Data();


                // Command - specify as StoredProcedure
                SqlCommand command = new SqlCommand(storedProcedure, con);
                command.CommandType = CommandType.StoredProcedure;

                AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode);
                AddParamToSqlCommand(command, "@Sales_Product_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, salesproductCode);
                AddParamToSqlCommand(command, "@Mapping_Product_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, mappingproductCode);
                AddParamToSqlCommand(command, "@Effective_From", ParameterDirection.Input, SqlDbType.VarChar, 30, effectiveFrom);
                AddParamToSqlCommand(command, "@Created_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, createdDate);
                AddParamToSqlCommand(command, "@Created_By", ParameterDirection.Input, SqlDbType.VarChar, 30, createdBy);
                AddParamToSqlCommand(command, "@Record_Status", ParameterDirection.Input, SqlDbType.VarChar, 1, recordStatus);
                // Return value as parameter
                SqlParameter returnValue = new SqlParameter("@Result", SqlDbType.VarChar);
                returnValue.Direction = ParameterDirection.Output;
                returnValue.Size      = 500;
                command.Parameters.Add(returnValue);

                if (db.OpenConnection(objCurentInfo.GetCompanyCode()))
                {
                    // Execute the stored procedure
                    db.ExecuteNonQuery(command);
                    db.CloseConnection();
                }

                //For Handle the Error

                return(returnValue.Value.ToString());
            }
            catch (Exception ex)
            {
                ErrorLog.LogError(ex, "productInsert()");
                return("ERROR");
            }
        }
Exemple #26
0
 public JsonResult GetselectedUserTypes(string divisionCodes, string UserTypeCodes)
 {
     try
     {
         DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
         string companyCode = string.Empty;
         string userCode    = string.Empty;
         companyCode = objCurInfo.GetCompanyCode();
         userCode    = objCurInfo.GetUserCode();
         List <MVCModels.HiDoctor_Master.UserTypeSplashModel> lstUsertype = new List <MVCModels.HiDoctor_Master.UserTypeSplashModel>();
         lstUsertype = _objBLSplashScreen.GetselectedUserTypes(companyCode, userCode, divisionCodes, UserTypeCodes).ToList();
         return(Json(lstUsertype, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #27
0
        public string GetSMSDetails(string userCode)
        {
            DataControl.JSONConverter json = new DataControl.JSONConverter();
            List <SendSMS>            lstSentSMSDetails = new List <SendSMS>();

            DataControl.BLMaster    _objMapping    = new DataControl.BLMaster();
            DataControl.CurrentInfo _objCurInfo    = new DataControl.CurrentInfo();
            StringBuilder           sbTableContent = new StringBuilder();

            lstSentSMSDetails = (List <SendSMS>)_objMapping.GetSentSMSDetails(userCode);
            try
            {
                if (lstSentSMSDetails != null && lstSentSMSDetails.Count > 0)
                {
                    sbTableContent.Append("<h4>User Name : " + lstSentSMSDetails[0].User_Name.ToString() + "</h4>");
                    sbTableContent.Append("<table id='tblUserInfo' class='table table-striped'>");
                    sbTableContent.Append("<thead class='active' style='display:block;text-align: center;' >");
                    sbTableContent.Append("<tr style='background-color: #428bca'>");
                    sbTableContent.Append("<td>Sender Name</td>");
                    //sbTableContent.Append("<td>User Name</td>");
                    sbTableContent.Append("<td>Mobile Number</td>");
                    sbTableContent.Append("<td>Date & Time</td>");
                    sbTableContent.Append("<td style='min-width: 319px;'>SMS Details</td>");
                    sbTableContent.Append("</tr>");
                    sbTableContent.Append("</thead>");
                    sbTableContent.Append("<tbody style='overflow-y: scroll;display: block;height: 300px;'>");
                    foreach (var item in lstSentSMSDetails)
                    {
                        sbTableContent.Append("<td>" + item.Sender_User_Name.ToString() + "</td>");
                        //sbTableContent.Append("<td>" + item.User_Name.ToString() + "</td>");
                        sbTableContent.Append("<td style ='min-width: 101px;'>" + item.Mobile_Number.ToString() + "</td>");
                        sbTableContent.Append("<td style ='min-width: 84px;'>" + item.Date_Time.ToString() + "</td>");
                        sbTableContent.Append("<td>" + item.SMS_Details.ToString() + "</td></tr>");
                    }
                    sbTableContent.Append("</tbody>");
                    sbTableContent.Append("</table>");
                }
                return(sbTableContent.ToString());
            }
            catch (Exception ex)
            {
                return("Sorry an error occured. Please try again later.");
            }
        }
Exemple #28
0
        public int UpdateRequestMapping(string requestCode, string userTypeCode, string mapCode)
        {
            DataControl.BLMaster    _objMapping = new DataControl.BLMaster();
            DataControl.CurrentInfo objCurInfo  = new DataControl.CurrentInfo();
            string companyCode = objCurInfo.GetCompanyCode();

            try
            {
                int result = _objMapping.UpdateRequestMapping(companyCode, requestCode, userTypeCode, mapCode);
                return(result);
            }
            catch (Exception ex) {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:companyCode", companyCode);
                dicContext.Add("Filter:requestCode", requestCode);
                dicContext.Add("Filter:userTypeCode", userTypeCode);
                dicContext.Add("Filter:userTypeCode", mapCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(2);
            }
        }
Exemple #29
0
        public string UpdateCustomerPriceGroup(string customerCodes, string priceGroupCode, string regionCode, string entity)
        {
            string result = string.Empty;

            DataControl.BLRegion    objRegion  = new DataControl.BLRegion();
            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            List <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = new List <MVCModels.HiDoctor_Master.DoctorModel>();

            if (!string.IsNullOrEmpty(customerCodes))
            {
                string[] ar;
                ar = customerCodes.Split('^');
                foreach (var dr in ar)
                {
                    if (!string.IsNullOrEmpty(dr.ToString()))
                    {
                        MVCModels.HiDoctor_Master.DoctorModel objCustomer = new MVCModels.HiDoctor_Master.DoctorModel();
                        objCustomer.Customer_Code    = dr.ToString();
                        objCustomer.Price_Group_Code = priceGroupCode;
                        objCustomer.Region_Code      = regionCode;
                        lstCustomer.Add(objCustomer);
                    }
                }
            }
            int rowsAffected = 0;

            rowsAffected = objRegion.UpdateCustomerPriceGroup(objCurInfo.GetCompanyCode(), lstCustomer, regionCode, entity);
            if (rowsAffected > 0)
            {
                result = "SUCCESS:Customer Price group mapping done successfully";
            }
            else
            {
                result = "ERROR:Error occured while mapping the price group to customer";
            }
            return(result);
        }
Exemple #30
0
        public string GetAllRegionTypes()
        {
            try
            {
                DataControl.DAL_Reports_CategoryWiseDrVisitAnalysis objDAL = new DataControl.DAL_Reports_CategoryWiseDrVisitAnalysis();
                DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo();

                DataSet       ds            = new DataSet();
                StringBuilder sbHtmlContent = new StringBuilder();

                string companyCode = _objcurrentInfo.GetCompanyCode();
                string regionALL   = "ALL";
                ds = objDAL.GetRegionTypes(companyCode);

                sbHtmlContent.Append("&nbsp;<input type=\"checkbox\" onclick=\"RegioncheckAll();\" id=\"chk_RT_ALL\" name=\"chck_RT\" value=\"" + regionALL + "\">");
                sbHtmlContent.Append("&nbsp;<label for=\"chk_RT_" + regionALL + "\">" + regionALL + "</label>");

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sbHtmlContent.Append("&nbsp;<input type=\"checkbox\" onclick='fnUserRegionChk(\"" + ds.Tables[0].Rows.Count + "\")' Class=\"clsCheckRegion\" id=\"chk_RT_" + dr["Region_Type_Name"].ToString() + "\" name=\"chck_RT\" value=\"" + dr["Region_Type_Name"].ToString() + "\">");
                    sbHtmlContent.Append("&nbsp;<label for=\"chk_RT_" + dr["Region_Type_Name"].ToString() + "\">" + dr["Region_Type_Name"].ToString() + "</label>");
                }

                return(sbHtmlContent.ToString());
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();

                dicContext.Add("Method:", MethodBase.GetCurrentMethod().Name);

                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);

                throw ex;
            }
        }