Esempio n. 1
0
        private void GetManufacturebyID()
        {
            ManufactureInfo dataById = Manufacture.GetDataById(WebUtils.GetQueryInt("id"));

            if (dataById != null)
            {
                base.Response.Write(JsonUtils.ObjectToJson <ManufactureInfo>(dataById));
            }
            else
            {
                base.Response.Write("{\"ret\":\"fail\",\"status\":0,\"msg\":\"Chúng tôi không tìm thấy bất kỳ dữ liệu\"}");
            }
        }
Esempio n. 2
0
        public static int Add(ManufactureInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <ManufactureInfo>(entity);
            }
            return(result);
        }
Esempio n. 3
0
 public static bool Update(ManufactureInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <ManufactureInfo>(entity));
 }
Esempio n. 4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            base.NeedLogin = true;
            base.ReturnUrl = Request.RawUrl;
            if (base.IsPost && base.UserID != -1)
            {
                string text    = WebUtils.GetFormString("_action", "add").ToLower();
                int    formInt = WebUtils.GetFormInt("_idcom");

                ManufactureInfo com = new ManufactureInfo();
                if (text.Equals("modify"))
                {
                    com = Manufacture.GetDataById(formInt);
                }
                com.Name    = WebUtils.GetFormString("name");
                com.Country = WebUtils.GetFormString("country");
                if (text == "del")
                {
                    if (Manufacture.Delete(formInt))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_DeleteFail"));
                    }
                }
                else if (string.IsNullOrEmpty(com.Name))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_NameNotEmpty"));
                }
                else if (string.IsNullOrEmpty(com.Country))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_PhoneNotEmpty"));
                }
                else if (text == "modify")
                {
                    if (Manufacture.Update(com))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_UpdateFail"));
                    }
                }
                else
                {
                    com.AutoTimeStamp = System.DateTime.Now;
                    int num = Manufacture.Add(com);
                    if (num > 0)
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_AddFail"));
                    }
                }
            }


            else
            {
                int pageSize = 15;

                StringBuilder builderCondition = new StringBuilder(" 1=1 ");

                string strSort = " AutoID desc ";

                StringBuilder builderUrlPattern = new StringBuilder(base.ResolveUrl("~/List_Manufacture.aspx"));
                builderUrlPattern.Append("?");
                builderUrlPattern.Append("&page=$page");

                CMSPager pager = contents.GetPager(BLL.Manufacture.GetCount(builderCondition.ToString()), intCurrentPage, pageSize, builderUrlPattern.ToString());
                base.Put("pager", pager);
                IList <ManufactureInfo> Manufacture = BLL.Manufacture.GetPagerList(builderCondition.ToString(), strSort, pager.PageIndex, pager.PageSize, ref intTotalCount, ref intTotalPage);
                base.Put("man", Manufacture);
                base.UsingClient("temp/content_Manufacture.html");
            }
        }
Esempio n. 5
0
        public uint GetManufactureInfo(uint nRobotID, ref ManufactureInfo myManufactureInfo)
        {
            uint nValue = 0;
            try
            {
                nValue = PTRobot_GetManufactureInfo( nRobotID, myManufactureInfo);
            }
            catch (Exception e)
            {
                MessageBox.Show("PTRobot_GetManufactureInfo() failed:\n" + e.Message);
            }

            return nValue;
        }