Beispiel #1
0
        /// <summary>
        /// 获取当前页面操作方法的ID
        /// </summary>
        /// <param name="sysPageMethod"></param>
        /// <returns></returns>
        private int getPageMethodId(SspPageMethod sspPageMethod)
        {
            var manager = AppBizFactory.CreateInstance <IPageMethodManager>();
            var method  = new SspPageMethod();

            method.PageId     = sspPageMethod.PageId;
            method.MethodName = sspPageMethod.MethodName;
            IList <SspPageMethod> lst = manager.GetEntityList(method);

            if (lst.Count > 0)
            {
                return(Convert.ToInt32(lst[0].ObjId));
            }
            return(0);
        }
Beispiel #2
0
    public string DeleteBillData(string OrderNo)
    {
        var manager = AppBizFactory.CreateInstance <IOutputBillManager>();

        try
        {
            manager.DeleteBillData(OrderNo);
            X.MessageBox.Alert("提示", "删除成功!").Show();
        }
        catch (Exception ex)
        {
            log.Error(ex);
            return(ex.Message);
        }
        return(string.Empty);
    }
Beispiel #3
0
 public string AddAgvTask(string palletId1, string sLocNo, string eLocNo)
 {
     try
     {
         var    manager   = AppBizFactory.CreateInstance <IAgvTaskManager>();
         string sLocPlcNo = manager.GetLocNo(sLocNo).LocPlcNo;
         string eLocPlcNo = manager.GetLocNo(eLocNo).LocPlcNo;
         string palletId  = palletId1;
         var    result    = manager.AddAgvTask(palletId, sLocNo, eLocNo, sLocPlcNo, eLocPlcNo);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
     return(string.Empty);
 }
Beispiel #4
0
 public string RequestTaskCmd(string palletNo, string sLocNo)
 {
     if (string.IsNullOrEmpty(palletNo) || string.IsNullOrEmpty(sLocNo))
     {
         return("信息缺失");
     }
     try
     {
         var manager = AppBizFactory.CreateInstance <ITaskManager>();
         return(manager.RequestTaskCmd(palletNo, sLocNo));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #5
0
 public string UpdateSrmArea(string CrnNo, string MinCol, string MaxCol)
 {
     try
     {
         if (int.Parse(MinCol) >= int.Parse(MaxCol))
         {
             return("堆垛机工作范围设置错误!");
         }
         var manager = AppBizFactory.CreateInstance <ICrnManager>();
         manager.UpdateSrmArea(CrnNo, MinCol, MaxCol);
         return(string.Empty);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #6
0
    public string SetBinUseFalg(string binNo, string useFlag)
    {
        var manager = AppBizFactory.CreateInstance <IBinDataManager>();
        var flag    = 0;

        int.TryParse(useFlag, out flag);
        if (flag == 0)
        {
            flag = 1;
        }
        else
        {
            flag = 0;
        }
        manager.ChanageBinUseFlag(binNo, flag);
        return(string.Empty);
    }
    public string SaveJsonInfo(string headerStr, string bodyStr)
    {
        if (string.IsNullOrWhiteSpace(headerStr))
        {
            return("请填写单据主信息!");
        }
        var headJson = McJsonConvert.McDeserializeObject(headerStr);

        if (headJson == null)
        {
            return("请填写单据主信息!");
        }
        if (string.IsNullOrWhiteSpace(bodyStr))
        {
            return("请填写单据行信息!");
        }
        var bodyJson = McJsonConvert.McDeserializeObjects(bodyStr);

        if (bodyJson == null)
        {
            return("请填写单据行信息!");
        }
        if (bodyJson.Length == 0)
        {
            return("请填写单据行信息!");
        }
        var header  = JsonToWbsOrder(headJson);
        var body    = JsonToWbsOrderLine(header, headJson, bodyJson);
        var manager = AppBizFactory.CreateInstance <IOutputBillManager>();

        try
        {
            var msg = manager.SaveOutputBill(header, body.ToArray());
            if (!string.IsNullOrWhiteSpace(msg))
            {
                return(msg);
            }
        }
        catch (Exception ex)
        {
            log.Error(ex);
            return(ex.Message);
        }
        return(string.Empty);
    }
Beispiel #8
0
    private void IniPageFieldData()
    {
        if (_.库位禁用.Permit == 0)
        {
            //this.btnBinDisable.Visible = false;
        }
        var manager  = AppBizFactory.CreateInstance <IBinDataManager>();
        var storData = manager.GetStoreBinData(99);
        var xCount   = storData.MaxBin.X;

        this.txtXCellBinNo.Items.Clear();
        for (int i = 1; i <= xCount; i++)
        {
            this.txtXCellBinNo.Items.Add(new Ext.Net.ListItem()
            {
                Text = "第【" + i.ToString() + "】行", Value = i.ToString()
            });
        }
    }
 public object GridPanelBindData(string action, Dictionary <string, object> extraParams)
 {
     try
     {
         var manager = AppBizFactory.CreateInstance <IAgvTaskManager>();
         var data    = manager.GetAgvTaskDataTable();
         var total   = data.Rows.Count;
         return(new { data = data, total });
     }
     catch (Exception ex)
     {
         X.MessageBox.Show(new MessageBoxConfig()
         {
             Title   = "提示",
             Message = ex.Message.ToString(),
             Icon    = MessageBox.Icon.WARNING
         });
     }
     return(null);
 }
Beispiel #10
0
 public string ForceDeleteTask(string taskNo)
 {
     if (string.IsNullOrWhiteSpace(taskNo))
     {
         return("任务号不能为空!");
     }
     try
     {
         var manager = AppBizFactory.CreateInstance <ITaskManager>();
         if (manager.DeleteWbsTask(taskNo))
         {
             return(string.Empty);
         }
         return("取消失败");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #11
0
 public string ForceDeleteCmd(string Objid)
 {
     if (string.IsNullOrWhiteSpace(Objid) || Objid.Equals("0"))
     {
         return("指令号不能为空!");
     }
     try
     {
         var manager = AppBizFactory.CreateInstance <ITaskManager>();
         if (manager.DeleteWbsTaskCmd(Objid))
         {
             return(string.Empty);
         }
         return("取消失败");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #12
0
        /// <summary>
        /// 将当前页面的菜单类保存到数据库
        /// </summary>
        /// <param name="page"></param>
        public void AddPageAction(PageAction pageAction)
        {
            var    manager = AppBizFactory.CreateInstance <IPageActionManager>();
            object max     = manager.GetMaxObjId(null);
            int    iMax    = 0;

            if (max != null)
            {
                int.TryParse(max.ToString(), out iMax);
            }
            iMax++;
            var sspPageAction = new SspPageAction();

            sspPageAction.ObjId      = iMax;
            sspPageAction.PageMenuId = pageAction.PageMenu.ObjId;
            sspPageAction.ActionId   = pageAction.ActionId;
            sspPageAction.ActionName = pageAction.ActionName;
            sspPageAction.ShowName   = pageAction.ShowName;
            sspPageAction.DeleteFlag = 0;
            manager.Insert(sspPageAction);
        }
Beispiel #13
0
        /// <summary>
        /// 保存日志信息
        /// </summary>
        /// <param name="method"></param>
        /// <param name="weblog"></param>
        public void AppendWebLog(WebLog weblog)
        {
            var sslWebLog = new SslWebLog();

            sslWebLog.PageId       = weblog.Method.PageMenu.ObjId;
            sslWebLog.UserId       = weblog.UserId;
            sslWebLog.UserIp       = weblog.UserIP;
            sslWebLog.MethodResult = weblog.MethodResult;
            sslWebLog.PageRequest  = weblog.PageRequest;
            sslWebLog.Remark       = weblog.Remark;

            var sysPageMethod = new SspPageMethod();

            sysPageMethod.PageId     = weblog.Method.PageMenu.ObjId;
            sysPageMethod.MethodName = weblog.Method.MethodName;

            var manager = AppBizFactory.CreateInstance <IWebLogManager>();

            sslWebLog.MethodId = AppendPageMethod(sysPageMethod);
            manager.Insert(sslWebLog);
        }
    public string AddMaterialInfo(string materialNo, string materialName)
    {
        try
        {
            var manager = AppBizFactory.CreateInstance <IMaterialManager>();

            var result = manager.AddMaterialInfo(materialNo, materialName);
            if (result > 0)
            {
                return("正确");
            }
            else
            {
                return("错误");
            }
        }
        catch (Exception ex)
        {
            return(ex.Message);
        }
        return(string.Empty);
    }
Beispiel #15
0
        /// <summary>
        /// 将当前页面的菜单类保存到数据库
        /// </summary>
        /// <param name="page"></param>
        public void AddPageMenu(PageMenu page)
        {
            var    manager = AppBizFactory.CreateInstance <IPageMenuManager>();
            object max     = manager.GetMaxObjId(null);
            int    iMax    = 0;

            if (max != null)
            {
                int.TryParse(max.ToString(), out iMax);
            }
            iMax++;
            var sspPageMenu = new SspPageMenu();

            sspPageMenu.ObjId      = iMax;
            sspPageMenu.MenuLevel  = "00" + iMax.ToString();
            sspPageMenu.IsShow     = 1;
            sspPageMenu.SeqIndex   = 1;
            sspPageMenu.PageUrl    = page.PageUrl;
            sspPageMenu.ShowName   = page.ShowName;
            sspPageMenu.DeleteFlag = 1;
            manager.Insert(sspPageMenu);
        }
Beispiel #16
0
 public string ChangeCrnOutputEnable(string crnNo, string enable)
 {
     try
     {
         var flag = 0;
         int.TryParse(enable, out flag);
         if (flag == 0)
         {
             flag = 1;
         }
         else
         {
             flag = 0;
         }
         var manager = AppBizFactory.CreateInstance <ICrnManager>();
         manager.SetCrnOutputEnable(crnNo, flag);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
     return(string.Empty);
 }
Beispiel #17
0
    public object GetTaskCmd(string action, Dictionary <string, object> extraParams)
    {
        PageResult pageResult = new PageResult();

        try
        {
            var param = new Hashtable(6);
            if (!string.IsNullOrWhiteSpace(this.txtTaskNo.Text))
            {
                param["TASK_NO"] = this.txtTaskNo.StringValue();
            }
            if (!string.IsNullOrWhiteSpace(this.txtPalletNo.Text))
            {
                param["PALLET_NO"] = this.txtPalletNo.StringValue();
            }
            StoreRequestParameters prms = new StoreRequestParameters(extraParams);
            if (prms.Limit <= 0)
            {
                return(pageResult.Data);
            }
            pageResult.PageSize        = prms.Limit;
            pageResult.PageIndex       = prms.Page;
            pageResult.ParameterObject = param;
            pageResult.OrderString     = "T1.CREATION_DATE ";

            var service = AppBizFactory.CreateInstance <ITaskManager>();
            pageResult = service.GetTaskData(pageResult);
        }
        catch (Exception ex)
        {
            X.MessageBox.Show(new MessageBoxConfig()
            {
                Title = "提示", Message = ex.Message, Icon = MessageBox.Icon.WARNING
            });
        }
        return(pageResult.Data);
    }
Beispiel #18
0
    public string changeLocAutoEnable(string locNo, string enable)
    {
        try
        {
            var flag = 0;
            int.TryParse(enable, out flag);    //enable转换为int,flag值为enable转化为int型后的值
            if (flag == 0)
            {
                flag = 1;
            }
            else
            {
                flag = 0;
            }
            var manager = AppBizFactory.CreateInstance <ILocAutoManager>();

            manager.SetLocAutoEnable(locNo, flag);
        }
        catch (Exception ex)
        {
            return(ex.Message);
        }
        return(string.Empty);
    }
Beispiel #19
0
    public object GridPanelBindData(string action, Dictionary <string, object> extraParams)
    {
        PageResult pageResult = new PageResult();

        try
        {
            StoreRequestParameters prms = new StoreRequestParameters(extraParams);
            if (prms.Limit <= 0)
            {
                return(pageResult.Data);
            }
            pageResult.PageSize  = prms.Limit;
            pageResult.PageIndex = prms.Page;
            pageResult           = AppBizFactory.CreateInstance <ILocAutoManager>().GetLocDataTable(pageResult);
        }
        catch (Exception ex)
        {
            X.MessageBox.Show(new MessageBoxConfig()
            {
                Title = "提示", Message = ex.Message.ToString(), Icon = MessageBox.Icon.WARNING
            });
        }
        return(pageResult.Data);
    }
Beispiel #20
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        int     userid = this.Data.User.UserId;
        SsbUser upuser = ssbUserManager.GetEntityList(new SsbUser()
        {
            ObjId = userid
        })[0];

        if (txtUserNewPassword1.Text.Trim().Length > 0)
        {
            if (txtUserNewPassword1.Text.Trim().Length == 0)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "错误提示",
                    Message = "修改密码必须输入原密码!",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR
                }
                           );
                return;
            }
            if (txtUserNewPassword1.Text.Trim() != txtUserNewPassword2.Text.Trim())
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "错误提示",
                    Message = "修改密码必须输入原密码!",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR
                }
                           );
                return;
            }
            SsbUser user = ssbUserManager.GetEntityList(new SsbUser()
            {
                ObjId = userid
            })[0];
            var    dencrypt  = AppBizFactory.CreateInstance <IMcPassword>();
            string spassword = dencrypt.DecryptString(user.UserPwd.Trim(), string.Empty, Encoding.ASCII);
            if (spassword != txtUserPassword.Text)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "错误提示",
                    Message = "原密码不正确!",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR
                });
                return;
            }
            var encrypt = AppBizFactory.CreateInstance <IMcPassword>();
            upuser.UserPwd = encrypt.EncryptString(txtUserNewPassword1.Text.Trim(), string.Empty, Encoding.ASCII);
        }
        upuser.RealName = txtUserRealName.Text == "" ? txtUserName.Text : txtUserRealName.Text;
        ssbUserManager.Update(upuser, new SsbUser()
        {
            ObjId = userid
        });
        txtUserPassword.Text     = string.Empty;
        txtUserNewPassword1.Text = string.Empty;
        txtUserNewPassword2.Text = string.Empty;
        X.Msg.Show(new MessageBoxConfig
        {
            Title   = "成功提示",
            Message = "用户信息修改成功!",
            Buttons = MessageBox.Button.OK,
            Icon    = MessageBox.Icon.INFO
        });
    }
Beispiel #21
0
    public string GetNewOrderNo()
    {
        var billManager = AppBizFactory.CreateInstance <IOutputBillManager>();

        return("E" + billManager.GetNewBillNo());
    }
Beispiel #22
0
    public void GetStoreStatus()//string xIdx
    {
        #region 数据整理
        var idx     = 0;
        var manager = AppBizFactory.CreateInstance <IBinDataManager>();

        //先读第一排的库存
        idx = 1;
        var storData  = manager.GetStoreBinData(idx);
        var dataTable = new DataTable("StoreStatusData");

        for (int y = 0; y <= storData.MaxBin.Y; y++)
        {
            var columnName = "F" + y.ToString("D2");
            dataTable.Columns.Add(new DataColumn()
            {
                ColumnName = columnName
            });
        }
        for (var z = storData.MaxBin.Z; z > 0; z--)
        {
            var row = dataTable.NewRow();
            dataTable.Rows.Add(row);
            row["F" + 0.ToString("D2")] = z.ToString("D2");
            for (int y = 1; y <= storData.MaxBin.Y; y++)
            {
                var columnName = "F" + y.ToString("D2");
                var data       = getBinStatusData(storData, y, z);
                if (data == null)
                {
                    row[columnName] = string.Empty;
                }
                else
                {
                    row[columnName] = McJsonConvert.SerializeObject(new BinData[] { data });
                }
            }
        }

        //插入一个空行
        var rownull = dataTable.NewRow();
        dataTable.Rows.Add(rownull);
        rownull["F" + 0.ToString("D2")] = "间隔";
        for (int y = 1; y <= storData.MaxBin.Y; y++)
        {
            var columnName = "F" + y.ToString("D2");
            rownull[columnName] = string.Empty;
        }

        //查询第二排的库存,插入到第一排后面
        idx = 2;
        var storData2 = manager.GetStoreBinData(idx);
        for (var z = storData2.MaxBin.Z; z > 0; z--)
        {
            var row = dataTable.NewRow();
            dataTable.Rows.Add(row);
            row["F" + 0.ToString("D2")] = z.ToString("D2");
            for (int y = 1; y <= storData2.MaxBin.Y; y++)
            {
                var columnName = "F" + y.ToString("D2");
                var data       = getBinStatusData(storData2, y, z);
                if (data == null)
                {
                    row[columnName] = string.Empty;
                }
                else
                {
                    row[columnName] = McJsonConvert.SerializeObject(new BinData[] { data });
                }
            }
        }

        #endregion

        #region 页面数据
        var grid  = this.gridMain;
        var store = grid.Store[0];
        store.Reader.Clear();
        grid.SelectionModel.Clear();
        grid.ColumnModel.Columns.Clear();
        store.Model.Clear();
        var model = new Model();
        for (int y = 0; y <= storData.MaxBin.Y; y++)
        {
            var columnName = "F" + y.ToString("D2");
            model.Fields.Add(new ModelField(columnName));
        }
        store.Model.Add(model);
        store.DataSource = dataTable;
        store.DataBind();
        #endregion

        #region 页面展示
        grid.SelectionModel.Add(new CellSelectionModel {
            Mode = SelectionMode.Single,
        });
        var columns = new List <ColumnBase>();
        columns.Add(new Column()
        {
            Sortable  = false,
            Hideable  = false,
            Draggable = false,
            Align     = Alignment.Center,
            DataIndex = ("F" + 0.ToString("D2")),
            Text      = 0.ToString("D2"),
            Resizable = false,
            Width     = 30,
        });
        for (int y = 1; y <= storData.MaxBin.Y; y++)
        {
            columns.Add(new Column()
            {
                Renderer = new Renderer()
                {
                    Fn = "columns_renderer"
                },
                Sortable  = false,
                Hideable  = false,
                Draggable = false,
                Align     = Alignment.Center,
                DataIndex = ("F" + y.ToString("D2")),
                Text      = y.ToString("D2"),
                Width     = 26,
                Resizable = false
            });
        }
        grid.ColumnModel.Columns.Add(columns);
        grid.Render();
        #endregion

        X.Js.Call("setonmouseover");
    }
Beispiel #23
0
    public void GetStoreStatus(string xIdx)
    {
        #region 数据整理
        var idx = 0;
        if (!int.TryParse(xIdx, out idx))
        {
            X.MessageBox.Alert("提示", "请输入正确的行值!" + xIdx).Show();
            return;
        }
        var manager   = AppBizFactory.CreateInstance <IBinDataManager>();
        var storData  = manager.GetStoreBinData(idx);
        var dataTable = new DataTable("StoreStatusData_" + xIdx);
        for (int y = 0; y <= storData.MaxBin.Y; y++)
        {
            var columnName = "F" + y.ToString("D2");
            dataTable.Columns.Add(new DataColumn()
            {
                ColumnName = columnName
            });
        }
        for (var z = storData.MaxBin.Z; z > 0; z--)
        {
            var row = dataTable.NewRow();
            dataTable.Rows.Add(row);
            row["F" + 0.ToString("D2")] = z.ToString("D2");
            for (int y = 1; y <= storData.MaxBin.Y; y++)
            {
                var columnName = "F" + y.ToString("D2");
                var data       = getBinStatusData(storData, y, z);
                if (data == null)
                {
                    row[columnName] = string.Empty;
                }
                else
                {
                    row[columnName] = McJsonConvert.SerializeObject(new BinData[] { data });
                }
            }
        }
        #endregion

        #region 页面数据
        var grid  = this.gridMain;
        var store = grid.Store[0];
        store.Reader.Clear();
        grid.SelectionModel.Clear();
        grid.ColumnModel.Columns.Clear();
        store.Model.Clear();
        var model = new Model();
        for (int y = 0; y <= storData.MaxBin.Y; y++)
        {
            var columnName = "F" + y.ToString("D2");
            model.Fields.Add(new ModelField(columnName));
        }
        store.Model.Add(model);
        store.DataSource = dataTable;
        store.DataBind();
        #endregion

        #region 页面展示
        // Reconfigure GridPanel
        grid.SelectionModel.Add(new CellSelectionModel {
            Mode = SelectionMode.Single,
        });
        var columns = new List <ColumnBase>();
        columns.Add(new Column()
        {
            Sortable  = false,
            Hideable  = false,
            Draggable = false,
            Align     = Alignment.Center,
            DataIndex = ("F" + 0.ToString("D2")),
            Text      = 0.ToString("D2"),
            Resizable = false,
            Width     = 30,
        });
        for (int y = 1; y <= storData.MaxBin.Y; y++)
        {
            columns.Add(new Column()
            {
                Renderer = new Renderer()
                {
                    Fn = "columns_renderer"
                },
                Sortable  = false,
                Hideable  = false,
                Draggable = false,
                Align     = Alignment.Center,
                DataIndex = ("F" + y.ToString("D2")),
                Text      = y.ToString("D2"),
                Width     = 26,
                Resizable = false
            });
        }
        grid.ColumnModel.Columns.Add(columns);
        grid.Render();
        #endregion

        X.Js.Call("setonmouseover");
    }