Beispiel #1
0
        public ActionResult OrgInfos2(int limit, int page, string Province, string CompanyCity, string CompanyUnderCity, string CompanyUnderArea)
        {
            PageModel ret = new PageModel();

            BLL.OrgInfoBLL _BLL  = new OrgInfoBLL();
            UserModel      user  = Session["UserModel"] as UserModel;
            string         OrgID = "";

            if (Province._ToInt32() > 0)
            {
                OrgID = Province;
            }
            if (CompanyCity._ToInt32() > 0)
            {
                OrgID = CompanyCity;
            }
            if (CompanyUnderCity._ToInt32() > 0)
            {
                OrgID = CompanyUnderCity;
            }
            if (CompanyUnderArea._ToInt32() > 0)
            {
                OrgID = CompanyUnderArea;
            }
            ret = _BLL.GetOrgByParentID(OrgID._ToInt32(), limit, page, user.OrgID, user.Level);
            var js = JsonConvert.SerializeObject(ret);

            return(Content(js));
        }
Beispiel #2
0
        protected void Return(object sender, System.EventArgs e, string returnMessage)
        {
            if (_itemFacade == null)
            {
                _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
            }
            ItemRoute2OP itemRoute2OP = (ItemRoute2OP)_itemFacade.GetItemRoute2Op(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            string target = this.MakeRedirectUrl("FOPBOMOperationComponetLoadingMP.aspx",
                                                 new string[] { "opid", "opcode", "itemcode", "opbomcode", "opbomversion", "routecode", "actiontype", "OrgID" },
                                                 new string[] { OPID, itemRoute2OP.OPCode, Server.UrlEncode(ItemCode), OPBOMCode, OPBOMVersion, Server.UrlEncode(RouteCode), this.Actiontype.ToString(), OrgID.ToString() });


            if (returnMessage.Trim().Length > 0)
            {
                Session["ReturnMessage"] = returnMessage;
            }

            this.Response.Redirect(target);
        }
 protected void cmdReturn_ServerClick(object sender, System.EventArgs e)
 {
     Response.Redirect(this.MakeRedirectUrl("FOPBOMOperationComponetLoadingMP.aspx",
                                            new string[] { "itemcode", "opbomcode", "opbomversion", "routecode", "opid", "OrgID" },
                                            new string[] { ItemCode, OPBOMCode, OPBOMVersion, RouteCode, OPID, OrgID.ToString() }));
 }
        protected override void Execute(CodeActivityContext context)
        {
            System.Net.WebRequest req = System.Net.WebRequest.Create("https://app.pipefy.com/queries");
            req.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
            req.Timeout           = 120000;
            req.Headers.Add("authorization", "Bearer " + Bearer.Get(context));
            req.ContentType = "application/json";
            req.Method      = "POST";
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes("{ \"query\": \"mutation { deleteOrganization(input: {id: " + OrgID.Get(context) + "}) { success } }\" }");
            req.ContentLength = bytes.Length;
            System.IO.Stream os = req.GetRequestStream();
            os.Write(bytes, 0, bytes.Length);
            os.Close();
            System.Net.WebResponse resp = req.GetResponse();
            System.IO.StreamReader sr   = new System.IO.StreamReader(resp.GetResponseStream());
            JArray  array      = new JArray();
            JObject joResponse = JObject.Parse(sr.ReadToEnd());

            Return.Set(context, joResponse.ToString());
        }
        //private void gridWebGrid_ClickCellButton(object sender, Infragistics.WebUI.UltraWebGrid.CellEventArgs e)
        //{
        //    if (this.gridHelper.IsClickEditColumn(e))
        //    {
        //        object obj = this.GetEditObject(e.Cell.Row);

        //        if (obj != null)
        //        {
        //            this.SetEditObject(obj);

        //            this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
        //        }
        //        SetcbSourceSBOMEdit(false);
        //    }
        //    if (e.Cell.Column.Key == "itemrange")
        //    {
        //        Response.Redirect(this.MakeRedirectUrl("FOPBOMItemControlMP.aspx",
        //            new string[] { "itemcode", "opbomcode", "opbomversion", "opid", "opbomitemcode", "routecode", "OrgID" },
        //            new string[] { ItemCode, OPBOMCode, OPBOMVersion, OPID, e.Cell.Row.Cells[2].Text, RouteCode, OrgID.ToString() }));
        //    }
        //}

        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    this.SetEditObject(obj);

                    this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
                }
            }

            else if (commandName == "itemrange")
            {
                Response.Redirect(this.MakeRedirectUrl("FOPBOMItemControlMP.aspx",
                                                       new string[] { "itemcode", "opbomcode", "opbomversion", "opid", "opbomitemcode", "routecode", "OrgID" },
                                                       new string[] { ItemCode, OPBOMCode, OPBOMVersion, OPID, row.Items.FindItemByKey("OPBOMItemCode").Value.ToString(), RouteCode, OrgID.ToString() }));
            }
        }
        //private void gridWebGrid_DblClick(object sender, Infragistics.WebUI.UltraWebGrid.ClickEventArgs e)
        //{
        //    object obj = this.GetEditObject(e.Row);

        //    if (obj != null)
        //    {
        //        this.SetEditObject(obj);

        //        this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
        //    }

        //}

        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            if (chbSourceSBOMEdit.Checked)
            {
                Response.Redirect(this.MakeRedirectUrl("FOPBOMOperationItemSP.aspx",
                                                       new string[] { "itemcode", "opbomcode", "opbomversion", "routecode", "opid", "actiontype", "OrgID" },
                                                       new string[] { ItemCode, OPBOMCode, OPBOMVersion, RouteCode, OPID, this.Actiontype.ToString(), OrgID.ToString() }));
            }
            else
            {
                object opBOMDetail = this.GetEditObject();

                if (opBOMDetail != null)
                {
                    if (_itemFacade == null)
                    {
                        _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
                    }
                    if (_itemFacade.GetMaterial(((OPBOMDetail)opBOMDetail).OPBOMItemCode, ((OPBOMDetail)opBOMDetail).OrganizationID) == null)
                    {
                        ExceptionManager.Raise(this.GetType().BaseType, "$Error_Material_NotFound", lblBOMItemCodeEdit.Text + ": " + ((OPBOMDetail)opBOMDetail).OPBOMItemCode);
                    }

                    if (_itemFacade.GetMaterial(((OPBOMDetail)opBOMDetail).OPBOMSourceItemCode, ((OPBOMDetail)opBOMDetail).OrganizationID) == null)
                    {
                        ExceptionManager.Raise(this.GetType().BaseType, "$Error_Material_NotFound", lblSourceItemCode.Text + ": " + ((OPBOMDetail)opBOMDetail).OPBOMSourceItemCode);
                    }

                    if (_opBOMFacade == null)
                    {
                        _opBOMFacade = new FacadeFactory(base.DataProvider).CreateOPBOMFacade();
                    }
                    DataProvider.BeginTransaction();
                    try
                    {
                        OPBOMDetail opBOPDTL = opBOMDetail as OPBOMDetail;
                        this._opBOMFacade.AddOPBOMItem(opBOPDTL);
                        //Laws Lu,2006/09/01

                        /*1,目前工序BOM建立逻辑不变,增加生效检查功能和失效功能,
                         * 初始建立的工序BOM资料处于失效状态,通过生效检查后处于生效状态,
                         * 此时不允许修改,只有失效状态的工序BOM才可以修改。
                         * 生效检查逻辑包括:完整的工序BOM包含的子阶物料(替代料)必须包含某工单所有的已发料物料代码,
                         * 比如,工单发料资料中包含5种物料,则工序BOM中的子阶物料必须也有这五种物料,
                         * 且首选料不能有这五种物料之外的其他物料。具体的工单由用户在界面指定。
                         * 举例如下:工单发料资料中有A,B,C,D四种物料*/
                        //Laws Lu,2006/12/15 取消默认为失效状态

                        MOFacade moFac = (new FacadeFactory(DataProvider)).CreateMOFacade();

                        object objOPBOM = moFac.GetOPBOM(opBOPDTL.ItemCode, opBOPDTL.OPBOMCode, opBOPDTL.OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);
                        //
                        if (objOPBOM != null)
                        {
                            OPBOM opBOM = objOPBOM as OPBOM;

                            opBOM.Avialable = 1;

                            moFac.UpdateOPBOM(opBOM);
                        }
                        // Added by Icyer 2005/08/16
                        // 同时将物料加入到物料主档中
                        BenQGuru.eMES.Material.WarehouseFacade wf = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
                        wf.AddWarehouseItem((OPBOMDetail)opBOMDetail);

                        DataProvider.CommitTransaction();
                        // Added end
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.Message);

                        DataProvider.RollbackTransaction();
                        throw ex;
                    }
                    finally
                    {
                        ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                    }

                    this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                    this.pagerToolBar.RowCount = GetRowCount();
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Add);
                }
            }
            SetcbSourceSBOMEdit(true);
        }
Beispiel #7
0
        public List <HG_OrganizationDetails> GetAll(int Orgid = 0)
        {
            var           CurrOrgID = HttpContext.Current.Request.Cookies["UserInfo"];
            SqlConnection Con       = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Con"].ToString());

            Con.Open();
            SqlCommand    cmd = null;
            SqlDataReader SDR = null;
            List <HG_OrganizationDetails> ListTmp = new List <HG_OrganizationDetails>();
            string Query = "SELECT * FROM  HG_OrganizationDetails ORDER BY OrgID  DESC";

            if (OrgID > 0)
            {
                Query = "SELECT * FROM  HG_OrganizationDetails where OrgID=" + OrgID.ToString() + "  ORDER BY OrgID  DESC";
            }
            else if (CurrOrgID != null && int.Parse(CurrOrgID["OrgId"]) > 0)
            {
                Query = "SELECT * FROM  HG_OrganizationDetails where OrgID=" + CurrOrgID["OrgId"] + "  ORDER BY OrgID  DESC";
            }
            try
            {
                cmd = new SqlCommand(Query, Con);
                SDR = cmd.ExecuteReader();
                while (SDR.Read())
                {
                    HG_OrganizationDetails ObjTmp = new HG_OrganizationDetails();
                    ObjTmp.OrgID            = SDR.GetInt32(0);
                    ObjTmp.OrgTypes         = SDR.GetString(1);
                    ObjTmp.HeadName         = SDR.GetString(2);
                    ObjTmp.Name             = SDR.GetString(3);
                    ObjTmp.Address          = SDR.GetString(4);
                    ObjTmp.City             = SDR.GetString(5);
                    ObjTmp.State            = SDR.GetString(6);
                    ObjTmp.PinCode          = SDR.GetString(7);
                    ObjTmp.Phone            = SDR.GetString(8);
                    ObjTmp.Cell             = SDR.GetString(9);
                    ObjTmp.Email            = SDR.GetString(10);
                    ObjTmp.WebSite          = SDR.GetString(11);
                    ObjTmp.Logo             = SDR.GetString(12);
                    ObjTmp.GSTNO            = SDR.GetString(15);
                    ObjTmp.PANNO            = SDR.GetString(16);
                    ObjTmp.BankName         = SDR.GetString(17);
                    ObjTmp.ACNO             = SDR.GetString(18);
                    ObjTmp.AcType           = SDR.GetString(19);
                    ObjTmp.Status           = SDR.GetBoolean(23);
                    ObjTmp.PaymentType      = SDR.IsDBNull(24)?1: SDR.GetInt32(24);
                    ObjTmp.IvoiceHeading    = SDR.IsDBNull(25) ? "  " : SDR.GetString(25);
                    ObjTmp.AddressLin2      = SDR.IsDBNull(26) ? "  " : SDR.GetString(26);
                    ObjTmp.AddressLine3     = SDR.IsDBNull(27) ? "  " : SDR.GetString(27);
                    ObjTmp.Licence2         = SDR.IsDBNull(28) ? "  " : SDR.GetString(28);
                    ObjTmp.License3         = SDR.IsDBNull(29) ? "  " : SDR.GetString(29);
                    ObjTmp.PrintRemark      = SDR.GetString(30);
                    ObjTmp.CustomerOrdering = SDR.GetBoolean(31);
                    ObjTmp.InvoiceTitle     = SDR.GetString(32);
                    ObjTmp.invoicePhone     = SDR.GetString(33);
                    ObjTmp.DistrictId       = SDR.GetInt32(34);
                    ObjTmp.InvoicePrintting = SDR.GetInt32(35);
                    ObjTmp.NuOfCopy         = SDR.GetInt32(36);
                    ObjTmp.OrderDisplay     = SDR.GetInt32(37);
                    ObjTmp.PrinttingType    = SDR.GetInt32(38);
                    ObjTmp.Copy             = SDR.GetInt32(39);
                    ObjTmp.WalletAmt        = SDR.GetDouble(40);
                    ListTmp.Add(ObjTmp);
                }
            }
            catch (System.Exception e) { e.ToString(); }
            finally { Con.Close(); }

            return(ListTmp);
        }