public ActionResult EmulationRead([DataSourceRequest] DataSourceRequest request, string Type)
        {
            string value = Type == "Emulation" ? "Type='" + Type + "'" : "Type<>'Emulation'";
            var    data  = KendoApplyFilter.KendoData <CRM_CS_ManageInfo>(request, value + " AND IsActive=1 AND ExpiredDate > GETDATE()");

            return(Json(data));
        }
Exemple #2
0
        public ActionResult CallHistoryRead([DataSourceRequest] DataSourceRequest request, string CustomerID)
        {
            string queryStr = "CustomerID = '" + CustomerID + "'";
           return Json(KendoApplyFilter.KendoData<CRM_Telesale_History_Call>(request, queryStr ));
            //return Json(KendoApplyFilter.KendoData<CRM_Telesale_History_Call>(request, ""));

        }
Exemple #3
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request, string ma_gian_hang = "")
 {
     if (accessDetail != null && (accessDetail.access["all"] || accessDetail.access["view"]))
     {
         using (IDbConnection db = OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
         {
             var data = new DataSourceResult();
             if (!isAdmin)
             {
                 data = KendoApplyFilter.KendoData <Merchant_Catalog>(request, "ma_gian_hang={0}".Params(currentUser.ma_gian_hang));
                 //return Json(db.Select<Merchant_Catalog>(s => s.ma_gian_hang == currentUser.ma_gian_hang).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
             }
             else
             {
                 if (!string.IsNullOrEmpty(ma_gian_hang.Trim()))
                 {
                     //return Json(db.Select<Merchant_Catalog>(s => s.ma_gian_hang == ma_gian_hang).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
                     data = KendoApplyFilter.KendoData <Merchant_Catalog>(request, " ma_gian_hang={0}".Params(currentUser.ma_gian_hang));
                 }
                 else
                 {
                     //return Json(db.Select<Merchant_Catalog>().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
                     data = KendoApplyFilter.KendoData <Merchant_Catalog>(request);
                 }
             }
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = MCC.Helpers.OrmliteConnection.openConn())
     {
         var strWhere  = "";
         var listgroup = currentUser.listUserGroup;
         if (listgroup.Count > 0)
         {
             foreach (var item in listgroup)
             {
                 //GroupAdmin System
                 if (item.id == 1)
                 {
                     strWhere = " 1=1";
                     break;
                 }
                 else
                 {
                     strWhere = " ma_gian_hang = '" + currentUser.ma_gian_hang + "' ";
                     break;
                 }
             }
         }
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <tw_User>(request, strWhere);
         return(Json(data));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = OrmliteConnection.openConn())
     {
         var data = KendoApplyFilter.KendoData <cms_BoxTin>(request);
         return(Json(data));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <Core.Entities.Menu>(request, "id_cha = -1");
         return(Json(data));
     }
 }
Exemple #7
0
 public ActionResult ReadLocation([DataSourceRequest] DataSourceRequest request, string ma_kho)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <Merchant_LocationWarehouse>(request, "ma_gian_hang={0} and ma_kho={1}".Params(currentUser.ma_gian_hang, ma_kho));
         return(Json(data));
     }
 }
Exemple #8
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = MCC.Helpers.OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <BIBIAM.Core.Entities.Merchant_Product_Price>(request);
         return(Json(data));
     }
 }
 public ActionResult ReadProductPrice([DataSourceRequest] DataSourceRequest request, string nha_cung_cap_id)
 {
     using (var dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <ProductPriceHeader>(request, "nha_cung_cap_id={0}".Params(nha_cung_cap_id));
         return(Json(data));
     }
 }
Exemple #10
0
 public ActionResult SMS_Template_Read([DataSourceRequest] DataSourceRequest request)
 {
     using (var dbConn = OrmliteConnection.openConn())
     {
         var list = KendoApplyFilter.KendoData <Deca_SMS_Template>(request);
         //var listGroup = UserGroup.GetAllUserGroups();
         return(Json(list, JsonRequestBehavior.AllowGet));
     }
 }
Exemple #11
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <UserGroup>(request);
         return(Json(data));
     }
 }
Exemple #12
0
 public ActionResult ReadDetail([DataSourceRequest] DataSourceRequest request, int order_id_header)
 {
     using (var dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <OrderDetail>(request, "order_id_header={0}".Params(order_id_header));
         return(Json(data));
     }
 }
        public ActionResult ExportData([DataSourceRequest] DataSourceRequest request)
        {
            if (asset.Export)
            {
                using (var dbConn = Helpers.OrmliteConnection.openConn())
                {
                    //using (ExcelPackage excelPkg = new ExcelPackage())
                    FileInfo fileInfo = new FileInfo(Server.MapPath(@"~\ExportExcelFile\Deca_CallHistory.xlsx"));
                    var      excelPkg = new ExcelPackage(fileInfo);

                    string fileName    = "Deca_CallHistory_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx";
                    string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    string query       = "";
                    request.PageSize = 50000;
                    var            data         = KendoApplyFilter.KendoData <DC_Telesales_CallHistory>(request);
                    ExcelWorksheet expenseSheet = excelPkg.Workbook.Worksheets["CallHistory"];
                    var            dataResult   = dbConn.Select <DC_Telesales_ResultList>();
                    int            rowData      = 1;

                    foreach (DC_Telesales_CallHistory item in data.Data)
                    {
                        int i = 1;
                        rowData++;

                        expenseSheet.Cells[rowData, i++].Value = item.CustomerID;
                        expenseSheet.Cells[rowData, i++].Value = item.CustomerName;
                        expenseSheet.Cells[rowData, i++].Value = item.Phone;
                        expenseSheet.Cells[rowData, i++].Value = item.PhysicalID;
                        expenseSheet.Cells[rowData, i++].Value = item.CustRule;
                        expenseSheet.Cells[rowData, i++].Value = dataResult.FirstOrDefault(a => a.Id == item.ResultID) == null ? "" : dataResult.FirstOrDefault(a => a.Id == item.ResultID).Description;
                        expenseSheet.Cells[rowData, i++].Value = dataResult.FirstOrDefault(a => a.Id == item.SubResultID) == null ? "" : dataResult.FirstOrDefault(a => a.Id == item.SubResultID).Description;
                        expenseSheet.Cells[rowData, i++].Value = item.Content;
                        expenseSheet.Cells[rowData, i++].Value = item.RecallTime;
                        expenseSheet.Cells[rowData, i++].Value = item.isDone.ToString();
                        expenseSheet.Cells[rowData, i++].Value = item.Source;
                        expenseSheet.Cells[rowData, i++].Value = item.OrderID;
                        expenseSheet.Cells[rowData, i++].Value = item.RefType;
                        expenseSheet.Cells[rowData, i++].Value = item.RefID;
                        expenseSheet.Cells[rowData, i++].Value = item.CreatedAt;
                        expenseSheet.Cells[rowData, i++].Value = item.CreatedBy;
                        expenseSheet.Cells[rowData, i++].Value = item.UpdatedAt;
                        expenseSheet.Cells[rowData, i++].Value = item.UpdatedBy;
                    }
                    MemoryStream output = new MemoryStream();
                    excelPkg.SaveAs(output);
                    output.Position = 0;
                    return(File(output.ToArray(), contentType, fileName));
                }
            }
            else
            {
                return(Json(new { success = false }));
            }
        }
Exemple #14
0
 public ActionResult ReadContactor([DataSourceRequest] DataSourceRequest request, string CompanyID)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         if (asset.View)
         {
             data = KendoApplyFilter.KendoData <DC_Company_Contractor>(request, "CompanyID = '" + CompanyID + "'");
         }
         return(Json(data));
     }
 }
Exemple #15
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         if (asset.View)
         {
             data = KendoApplyFilter.KendoData <Deca_SMSMO>(request);
         }
         return(Json(data));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     if (accessDetail != null && (accessDetail.access["all"] || accessDetail.access["view"]))
     {
         using (var dbConn = MCC.Helpers.OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
         {
             var data = KendoApplyFilter.KendoData <BrandManagement>(request);
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
     }
     return(RedirectToAction("NoAccess", "Error"));
 }
Exemple #17
0
 public ActionResult ReadDetail([DataSourceRequest] DataSourceRequest request, string ma_phieu_header)
 {
     using (var dbConn = Helpers.OrmliteConnection.openConn())
     {
         if (accessDetail.xem)
         {
             var data = new DataSourceResult();
             data = KendoApplyFilter.KendoData <StatementDetail>(request, "ma_phieu_header={0}".Params(ma_phieu_header));
             return(Json(data));
         }
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
Exemple #18
0
 public ActionResult ReadDetail([DataSourceRequest] DataSourceRequest request, string ma_to_trinh_ncc = "")
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         if (accessDetail.xem)
         {
             var data = new DataSourceResult();
             data = KendoApplyFilter.KendoData <StatementVendorDetail>(request, "ma_to_trinh_ncc={0}".Params(ma_to_trinh_ncc));
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <Vendor>(request);
         foreach (Vendor d in data.Data)
         {
             d.listMa_phan_cap = dbConn.GetFirstColumn <string>("SELECT ma_phan_cap FROM VendorProductCategory where nha_cung_cap_id ={0}", d.nha_cung_cap_id);
         }
         return(Json(data));
     }
 }
Exemple #20
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (var dbConn = Helpers.OrmliteConnection.openConn())
     {
         if (accessDetail.xem)
         {
             var data = new DataSourceResult();
             data = KendoApplyFilter.KendoData <POHeader>(request);
             return(Json(data));
         }
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (var dbConn = Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         data = KendoApplyFilter.KendoData <Article>(request);
         foreach (Article item in data.Data)
         {
             item.danh_sach_chi_nhanh = dbConn.GetFirstColumn <string>("select ma_chi_nhanh from ArticleBranch where ma_tin_id =" + item.id);
         }
         return(Json(data));
     }
 }
 public ActionResult DailyNew_Read([DataSourceRequest] DataSourceRequest request)
 {
     if (asset.View)
     {
         using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
         {
             return(Json(KendoApplyFilter.KendoData <CRM_CS_ManageInfo>(request)));
         }
     }
     else
     {
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
Exemple #23
0
        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            using (IDbConnection dbConn = Helpers.OrmliteConnection.openConn())
            {
                var data = new DataSourceResult();

                data = KendoApplyFilter.KendoData <Article>(request);
                //else
                //{
                //    data = KendoApplyFilter.KendoData<Article>(request,"companycode IN (SELECT showroomId FROM tw_UserInShowroom WHERE userId IN (SELECT id FROM [Users] WHERE name = '" + User.Identity.Name + "'))");
                //}
                return(Json(data));
            }
        }
Exemple #24
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     using (IDbConnection dbConn = MCC.Helpers.OrmliteConnection.openConn())
     {
         var data = new DataSourceResult();
         if (isAdmin == true)
         {
             data = KendoApplyFilter.KendoData <Merchant_Warehouse>(request);
         }
         else
         {
             data = KendoApplyFilter.KendoData <Merchant_Warehouse>(request, " ma_gian_hang={0} ".Params(currentUser.ma_gian_hang));
         }
         return(Json(data));
     }
 }
Exemple #25
0
 public ActionResult ReadAction([DataSourceRequest] DataSourceRequest request, string CompanyID)
 {
     if (asset.View)
     {
         var data = new DataSourceResult();
         if (asset.View)
         {
             data = KendoApplyFilter.KendoData <DC_Company_Action>(request, " CompanyID = '" + CompanyID + "'");
         }
         return(Json(data));
     }
     else
     {
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
Exemple #26
0
 public ActionResult Bank_Read([DataSourceRequest] DataSourceRequest request)
 {
     if (asset.View)
     {
         var data = new DataSourceResult();
         if (asset.View)
         {
             data = KendoApplyFilter.KendoData <DC_Bank_Definition>(request);
         }
         return(Json(data));
     }
     else
     {
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
Exemple #27
0
 public ActionResult Installment_Read([DataSourceRequest] DataSourceRequest request, string BankID)
 {
     if (asset.View)
     {
         var data = new DataSourceResult();
         if (asset.View)
         {
             data = KendoApplyFilter.KendoData <Deca_Bank_Installment>(request, " BankID = '" + BankID + "'");
         }
         return(Json(data));
     }
     else
     {
         return(RedirectToAction("NoAccessRights", "Error"));
     }
 }
Exemple #28
0
 public ActionResult ReadOrder([DataSourceRequest] DataSourceRequest request)
 {
     if (accessDetail != null && (accessDetail.access["all"] || accessDetail.access["view"]))
     {
         using (var dbConn = MCC.Helpers.OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
         {
             var data = new DataSourceResult();
             if (isAdmin)
             {
                 data = KendoApplyFilter.KendoData <Merchant_OrderHeader>(request, "trang_thai_don_hang={0}".Params(AllConstant.trang_thai_don_hang.CONFIRM));
             }
             else
             {
                 data = KendoApplyFilter.KendoData <Merchant_OrderHeader>(request, "trang_thai_don_hang={0} and ma_gian_hang={1}".Params(AllConstant.trang_thai_don_hang.CONFIRM, currentUser.ma_gian_hang));
             }
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
     }
     return(RedirectToAction("NoAccess", "Error"));
 }
Exemple #29
0
 public ActionResult Read([DataSourceRequest] DataSourceRequest request)
 {
     if (accessDetail != null && (accessDetail.access["all"] || accessDetail.access["view"]))
     {
         using (var dbConn = MCC.Helpers.OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
         {
             var data = new DataSourceResult();
             if (isAdmin)
             {
                 data = KendoApplyFilter.KendoDataByQuery <Customer>(request, "select b.*,a.ma_gian_hang from Merchant_Customer a left join Customer b on a.ma_khach_hang=b.ma_khach_hang", "");
             }
             //data = KendoApplyFilter.KendoData<Customer>(request);
             else
             {
                 data = KendoApplyFilter.KendoData <Customer>(request, "select b.*,a.ma_gian_hang from Merchant_Customer a left join Customer b on a.ma_khach_hang=b.ma_khach_hang where a.ma_gian_hang={0}".Params(currentUser.ma_gian_hang));
             }
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
     }
     return(RedirectToAction("NoAccess", "Error"));
 }
        public ActionResult ReadHeader([DataSourceRequest] DataSourceRequest request)
        {
            if (accessDetail != null && (accessDetail.access["all"] || accessDetail.access["view"]))
            {
                using (var dbConn = MCC.Helpers.OrmliteConnection.openConn(AppConfigs.MCCConnectionString))
                {
                    //var data = db.Select<Merchant_StockInDetail>("ma_phieu_nhap_kho = {0} and ma_gian_hang = {1}", ma_phieu, currentUser.ma_gian_hang).OrderBy(s => s.ma_san_pham);
                    var data = new DataSourceResult();

                    if (isAdmin)
                    {
                        data = KendoApplyFilter.KendoData <Merchant_StockInHeader>(request);
                    }
                    else
                    {
                        data = KendoApplyFilter.KendoData <Merchant_StockInHeader>(request, "ma_gian_hang = {0}".Params(currentUser.ma_gian_hang));
                    }
                    return(Json(data, JsonRequestBehavior.AllowGet));
                }
            }
            return(RedirectToAction("NoAccess", "Error"));
        }