コード例 #1
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object LoadAuctionInf()
        {
            Object         r   = null;
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                Int32 specHeadType = 1;
                switch (rqp.Command)
                {
                case "Prep.F0.ExistsAuctionInf":
                    r = F0Command.ExistsAuctionInf(rqp.SessionId, rqp["auctionNumber"] as String);
                    break;

                case "Prep.F0.LoadAuctionInf":
                    String auctionHref = null;
                    r = F0Command.LoadAuctionInf(rqp.SessionId, rqp["auctionNumber"] as String, auctionHref, specHeadType);
                    break;

                case "Prep.F0.LoadByRegion":
                    r = F0Command.LoadByRegion(rqp.SessionId, rqp["regionNumber"] as String, rqp["publishDate"] as String);
                    break;

                default:
                    r = String.Format("Ошибка: Неизвестная команда: '{0}'.", rqp.Command);
                    break;
                }
            }
            else
            {
                r = "Ошибка: Неверный формат запроса.";
            }
            return(r);
        }
コード例 #2
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object Save()
        {
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            String         settingsDsAsJsonString = F0Model.Set(rqp);

            return(settingsDsAsJsonString);
        }
コード例 #3
0
        public Object SaveTableV2()
        {
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            String         msg = F1Model.SaveTableV2(rqp);

            return(msg);// "Для проверки сохранения надо презагрузить таблицу.";
        }
コード例 #4
0
        public Object GetInstructions()
        {
            Object         r    = null;
            String         json = null;
            RequestPackage rqp  = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null && rqp.Parameters != null && rqp.Parameters.Length >= 3)
            {
                Guid guid;
                if (Guid.TryParse(rqp.Parameters[0].Value as String, out guid))
                {
                    String nr = rqp.Parameters[1].Value as String;
                    String id = rqp.Parameters[2].Value as String;
                    json = TnModel.GetInstruction(guid, nr, id);
                }
            }
            if (!String.IsNullOrWhiteSpace(json))
            {
                r = PartialView("~/Areas/Tn/Views/TnInstructions.cshtml", json);
            }
            else
            {
                r = "GetInstructions: Error in request.";
            }
            return(r);
        }
コード例 #5
0
ファイル: GroupsController.cs プロジェクト: q4472/FarmSib
        public Object GetFieldValueList()
        {
            Object         result    = null;
            RequestPackage rqp       = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            String         fieldName = rqp["field"] as String;

            if (!String.IsNullOrWhiteSpace(fieldName))
            {
                String term = rqp["term"] as String;
                if (!String.IsNullOrWhiteSpace(term))
                {
                    rqp.Command = "Goods.dbo.get_field_value_list";
                    //rqp.AddSessionIdToParameters();
                    ResponsePackage rsp = rqp.GetResponse("http://" + NskdEnv.DATA_SERVICE_HOST + ":" + NskdEnv.DATA_SERVICE_HOST_SQL_PORT_V12 + "/");
                    DataTable       dt  = rsp.GetFirstTable();
                    if (dt != null && dt.Rows.Count > 0 && dt.Columns.Count > 1 && dt.Columns[1].DataType == typeof(String))
                    {
                        String[] list = new String[dt.Rows.Count];
                        for (Int32 ri = 0; ri < dt.Rows.Count; ri++)
                        {
                            list[ri] = dt.Rows[ri][1] as String;
                        }
                        result = list;
                    }
                }
            }
            return(Nskd.JsonV2.ToString(result));
        }
コード例 #6
0
        public Object Save()
        {
            String status = null;
            var    rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                switch (rqp.Command)
                {
                case "save":
                    status = F1Model.Upsert(rqp);
                    break;

                case "delete":
                    status = F1Model.Delete(rqp);
                    break;

                default:
                    break;
                }
            }
            else
            {
                status = "Ошибка в формате команды.";
            }
            return(status);
        }
コード例 #7
0
ファイル: F0Controller.cs プロジェクト: q4472/fNet.AdminPages
        public Object Index()
        {
            Object       v      = null;
            F0Model      m      = new F0Model();
            StreamReader reader = new StreamReader(Request.InputStream, Request.ContentEncoding);
            String       body   = reader.ReadToEnd();

            if (!String.IsNullOrWhiteSpace(body))
            {
                if (body[0] == '{')
                {
                    RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
                    m.Get(rqp.SessionId, rqp);
                }
                else if (body[0] == 's' && body.Length == 46)
                {
                    if (Guid.TryParse(body.Substring(10, 36), out Guid sessionId))
                    {
                        m.Get(sessionId, null);
                    }
                }
            }
            v = PartialView("~/Views/F0/Index.cshtml", m);
            return(v);
        }
コード例 #8
0
        public Object Save()
        {
            Object result = null;
            var    rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                switch (rqp.Command)
                {
                case "insert":
                    var     dt = F1Model.Insert(rqp);
                    F1Model m  = new F1Model(dt);
                    result = PartialView("~/Views/F1/FilteredView.cshtml", m);
                    break;

                case "update":
                    result = F1Model.Update(rqp);
                    break;

                case "delete":
                    result = F1Model.Delete(rqp);
                    break;

                default:
                    break;
                }
            }
            else
            {
                result = "Ошибка в формате команды.";
            }
            return(result);
        }
コード例 #9
0
        public Object CreatePrepSpecTable()
        {
            String         msg = "";
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            msg = F2Model.CreatePrepSpecTable(rqp);
            return(msg);
        }
コード例 #10
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object CalcOutgoingPrices()
        {
            String         msg = "Start MvcApplication2.Areas.Prep.Controllers.F0Controller.CalcOutgoingPrices().";
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            msg = SpecHead.CalcOutgoingPrices(rqp);
            return(msg);
        }
コード例 #11
0
        public Object Set()
        {
            String         msg = "EnvController.Set: ";
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            msg += EnvModel.Set(rqp);
            return(msg);
        }
コード例 #12
0
        public Object Get()
        {
            RequestPackage  rqp  = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            ResponsePackage rsp  = EnvModel.Get(rqp);
            String          data = Nskd.JsonV2.ToString(rsp);

            return(data);
        }
コード例 #13
0
        public Object GetDataForSelectorWithListBox()
        {
            var               rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            Object            dt  = F1Model.GetDataForSelectorWithListBox(rqp);
            PartialViewResult r   = PartialView("~/Views/F1/ListBox1.cshtml", dt);

            return(r);
        }
コード例 #14
0
        public Object GetDataForDetailSection()
        {
            var     rqp  = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F1Model m    = new F1Model(rqp["f0"] as String);
            var     view = PartialView("~/Views/F1/Detail.cshtml", m);

            return(view);
        }
コード例 #15
0
        public Object GetDataForFilteredView()
        {
            var     rqp  = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F1Model m    = new F1Model(rqp);
            var     view = PartialView("~/Views/F1/FilteredView.cshtml", m);

            return(view);
        }
コード例 #16
0
        public Object Corr()
        {
            Object         v   = "DeliverySchedule.Controllers.F3Controller.Corr()";
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F3Model        m   = new F3Model(rqp, HttpContext.IsDebuggingEnabled);

            m.Corr();
            return(v);
        }
コード例 #17
0
ファイル: DgvController.cs プロジェクト: q4472/FarmSib
        public Object Index()
        {
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            Object[] log = rqp["log"] as Object[];
            String   msg = DgvModel.Exec(log);

            return(msg);
        }
コード例 #18
0
ファイル: GroupsController.cs プロジェクト: q4472/FarmSib
        public Object CommitLog()
        {
            Object         result = "MvcApplication2.Areas.Items.Controllers.GroupsController.CommitLog()";
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            GroupsModel    m      = new GroupsModel();

            m.CommitLog(rqp);
            return(result);
        }
コード例 #19
0
ファイル: F0Controller.cs プロジェクト: q4472/fNet.AdminPages
        public Object Save()
        {
            Object         v   = "FNet.AdminPages.Controllers.F0Controller.Save()";
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F0Model        m   = new F0Model();

            m.Save(rqp);
            return(v);
        }
コード例 #20
0
        public Object Index()
        {
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F3Model        m   = new F3Model(rqp);

            m.Load(rqp);
            PartialViewResult pvr = PartialView("~/Areas/Order/Views/F3/Index.cshtml", m);

            return(pvr);
        }
コード例 #21
0
ファイル: F0Controller.cs プロジェクト: q4472/fNet.AdminPages
        public Object ApplyFilter()
        {
            Object         v   = null;
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            F0Model        m   = new F0Model();

            m.ApplyFilter(rqp);
            v = PartialView("~/Views/F0/Table.cshtml", m);
            return(v);
        }
コード例 #22
0
ファイル: GroupsController.cs プロジェクト: q4472/FarmSib
        public Object SelectGroup()
        {
            Object         result = "MvcApplication2.Areas.Items.Controllers.GroupsController.SelectGroup()";
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            GroupsModel    m      = new GroupsModel();

            m.SelectGroup(rqp);
            result = PartialView("~/Areas/Items/Views/Groups/TableForItemsInGroup.cshtml", m);
            return(result);
        }
コード例 #23
0
ファイル: GroupsController.cs プロジェクト: q4472/FarmSib
        public Object UpsertGroup()
        {
            Object         result = "AreasItems.Areas.Items.Controllers.GroupsController.UpsertGroup()";
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            GroupsModel    m      = new GroupsModel();

            m.UpsertGroup(rqp);
            result = PartialView("~/Areas/Items/Views/Groups/GroupPart.cshtml", m);
            return(result);
        }
コード例 #24
0
        public Object Index()
        {
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            Int32          specId = 0;

            Int32.TryParse(rqp["specId"] as String, out specId);
            PartialViewResult pvr = PartialView("~/Areas/Prep/Views/F2/Index.cshtml");

            pvr.TempData.Add("specId", specId);
            return(pvr);
        }
コード例 #25
0
ファイル: F4Controller.cs プロジェクト: q4472/FarmSib
        public Object LoadS()
        {
            ResponsePackage rsp = null;
            RequestPackage  rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                rsp = Models.F4Model.LoadS(rqp);
            }
            return(Nskd.JsonV2.ToString(rsp));
        }
コード例 #26
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object ApplyFilter()
        {
            RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            // сохраняем новое значение фильтра в параметрах среды
            EnvModel.Set(rqp, "prep_f0_filter.");

            F0Model m = new F0Model(rqp);

            return(PartialView("~/Areas/Prep/Views/F0/FilteredView.cshtml", m));
        }
コード例 #27
0
        public Object GetUData()
        {
            Object         result    = "AreasItems.Areas.Tn.Controllers.TnController.GetUData()";
            RequestPackage rqp       = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            String         fCode     = rqp["fCode"] as String;
            Guid           sessionId = rqp.SessionId;
            TnModel        m         = new TnModel();
            DataSet        ds        = m.GetUData(sessionId, fCode);

            result = Nskd.JsonV2.ToString(ds);
            //result = PartialView("~/Areas/Tn/Views/1cData.cshtml", m);
            return(result);
        }
コード例 #28
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object PassToTender()
        {
            Object         r             = "MvcApplication2.Areas.Prep.Controllers.F0Controller.PassToTender()";
            RequestPackage rqp           = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);
            Guid           sessionId     = rqp.SessionId;
            String         auctionNumber = rqp["auctionNumber"] as String;

            if (!String.IsNullOrWhiteSpace(auctionNumber))
            {
                r = F0Command.PassToTender(sessionId, auctionNumber);
            }
            return(r);
        }
コード例 #29
0
ファイル: F0Controller.cs プロジェクト: q4472/FarmSib
        public Object CreateSpec()
        {
            Int32          specId = 0;
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                Guid sessionId = new Guid();
                Guid.TryParse(rqp["SessionId"] as String, out sessionId);
                specId = F0Model.CreateSpec(sessionId);
            }
            return(specId.ToString());
        }
コード例 #30
0
        public Object Index()
        {
            Object         result = null;
            RequestPackage rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null &&
                Int32.TryParse(rqp["specId"] as String, out Int32 specId))
            {
                F1Model m = new F1Model(rqp.SessionId, specId, Request.Url);
                result = PartialView("~/Areas/Prep/Views/F1/Index.cshtml", m);
            }
            return(result);
        }