コード例 #1
0
ファイル: Information_group.ashx.cs プロジェクト: inlost/moyo
 public void groupNew()
 {
     int rst = 0;
     if (theContext.Session["isLogin"] != null && theContext.Session["isLogin"].ToString() == "true")
     {
         string name = theContext.Request.Form["newGroup_name"];
         int uid = Convert.ToInt32(theContext.Session["id"]);
         string introduce = theContext.Request.Form["newGroup_introduce"];
         int joinType =Convert .ToInt32( theContext.Request.Form["newGroup_joinType"]);
         if (theContext.Request.Files.Count != 0)
         {
             moyu.Upload.image myImage = new Upload.image();
             myImage.UploadFileSize = 1;
             myImage.IsAddWaterMark = false;
             myImage.Minheight = 60;
             myImage.Minwidth = 60;
             myImage.Suowidth = 80;
             myImage.IsRate = true;
             DateTime dt = DateTime.Now;
             string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
             myImage.Upload(uploadPath, theContext.Request.Files[0]);
             if (name.Trim().Length == 0 || introduce.Trim().Length == 0 || myImage.IsSuccess == false)
             {
                 rst = 0;
             }
             else
             {
                 rst = myGroup.group_apply(name, uid, introduce, joinType, uploadPath + myImage.TFullName);
             }
         }
         else
         {
             rst = 0;
         }
     }
     else
     {
         rst = 0;
     }
     theContext.Response.Write("<script>window.parent.moyo.Group.applyBack("+rst+");</script>");
 }
コード例 #2
0
ファイル: User.ashx.cs プロジェクト: inlost/moyo
 public void avatarUp()
 {
     Upload.image myImage = new Upload.image();
     myImage.IsSuoImg = false;
     myImage.UploadFileSize = 2;
     myImage.IsAddWaterMark = false;
     myImage.Minwidth = 50;
     myImage.Minheight = 50;
     myImage.IsUseRandFileName = true;
     myImage.IsRarPic = true;
     myImage.Rarwidth = 320;
     DateTime dt = DateTime.Now;
     string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
     myImage.Upload(uploadPath, theContext.Request.Files[0]);
     if (myImage.IsSuccess)
     {
         theContext.Response.Write("<script>window.parent.moyo.setting.avatarUploadBack('" +uploadPath.Replace("\\","/")+ myImage.OFullName + "');</script>");
     }
     else
     {
         theContext.Response.Write("<script>window.parent.moyo.setting.avatarUploadBack(0);</script>");
     }
 }
コード例 #3
0
ファイル: shop.aspx.cs プロジェクト: inlost/moyo
 protected void Button1_Click(object sender, EventArgs e)
 {
     int cat = Convert.ToInt32(DropDownList1.SelectedValue);
     string name = TextName.Text.Trim();
     string introduce = TextIntroduce.Text.Trim();
     string address = TextAddress.Text.Trim();
     string phone = TextPhone.Text.Trim();
     double pointX = Convert.ToDouble(TextX.Text.Trim());
     double pointY = Convert.ToDouble(TextY.Text.Trim());
     string time = TextTime.Text.Trim();
     bool isDisplay = RadioButtonList1.SelectedValue == "0" ? false : true;
     bool isActive = true;
     int source = 0;
     moyu.Upload.image myImage = new Upload.image();
     myImage.UploadFileSize = 3;
     myImage.WaterMarkMode = 1;
     myImage.Minwidth = 50;
     myImage.Minheight = 50;
     myImage.Suowidth = 60;
     myImage.IsRate = true;
     DateTime dt = DateTime.Now;
     string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
     if (FileUpload1.HasFile)
     {
         myImage.Upload(uploadPath, FileUpload1.PostedFile);
     }
     string pic =FileUpload1.HasFile? (uploadPath+ myImage.TFullName):"";
     Living.shops myShop = new Living.shops();
     myShop.shop_add(cat, pic, name, introduce, address, phone, pointX, pointY, time, isDisplay, isActive, source);
     TextName.Text = "";
     TextIntroduce.Text = "";
     TextAddress.Text = "";
     TextPhone.Text = "";
     TextX.Text = "";
     TextY.Text = "";
     TextTime.Text = "";
 }
コード例 #4
0
ファイル: good.aspx.cs プロジェクト: inlost/moyo
 protected void Button1_Click(object sender, EventArgs e)
 {
     int cid = Convert .ToInt32( DropDownList2.SelectedValue);
     string name = TextName.Text.Trim();
     string seller = TextSeller.Text.Trim();
     int saleType = Convert.ToInt32(DropDownList3.SelectedValue);
     string introduce = TextIntroduce.Text.Trim();
     double price = Convert.ToDouble(TextPrice.Text);
     moyu.Upload.image myImage = new Upload.image();
     myImage.UploadFileSize = 3;
     myImage.WaterMarkMode = 1;
     myImage.Minwidth = 90;
     myImage.Minheight = 90;
     myImage.Suowidth = 150;
     myImage.IsRate = true;
     DateTime dt = DateTime.Now;
     string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
     myImage.Upload(uploadPath, FileUpload1.PostedFile);
     if (name.Length > 4 && myImage.IsSuccess)
     {
         myGoods.goodAdd(cid, name, price , uploadPath + myImage.TFullName, introduce, seller, saleType);
     }
     Response.Redirect("good.aspx");
 }
コード例 #5
0
ファイル: Information_Topic.ashx.cs プロジェクト: inlost/moyo
 private string avatarUp()
 {
     Upload.image myImage = new Upload.image();
     myImage.IsSuoImg = false;
     myImage.UploadFileSize = 2;
     myImage.IsAddWaterMark = false;
     myImage.Minwidth = 50;
     myImage.Minheight = 50;
     myImage.Maxwidth = 3000;
     myImage.Maxheight = 3000;
     myImage.IsUseRandFileName = true;
     myImage.IsRarPic = true;
     myImage.Rarwidth = 320;
     DateTime dt = DateTime.Now;
     string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
     myImage.Upload(uploadPath, theContext.Request.Files[0]);
     if (myImage.IsSuccess)
     {
         return uploadPath.Replace("\\", "/") + myImage.OFullName;
     }
     else
     {
         return "";
     }
 }
コード例 #6
-1
ファイル: cat.aspx.cs プロジェクト: inlost/moyo
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                int cat = Convert.ToInt32(DropDownList1.SelectedValue);
                string title = TextAdTitle.Text.Trim();
                string url = TextAdUrl.Text.Trim();
                int type = 0;
                moyu.Upload.image myImage = new Upload.image();
                myImage.UploadFileSize = 3;
                myImage.WaterMarkMode = 1;
                myImage.Minwidth = 50;
                myImage.Minheight = 50;
                myImage.IsSuoImg = true;
                myImage.Suoheight = 150;
                myImage.Suowidth = 150;
                myImage.IsRate = true;
                DateTime dt=DateTime.Now;
                string uploadPath = "\\upload\\images\\" + dt.Year.ToString() + "\\" + dt.Month + "\\" + dt.Day + "\\";
                myImage.Upload(uploadPath, FileUpload1.PostedFile);
                myShop.cat_ad_add(cat, title, uploadPath+ myImage.TFullName, url, type);
            }
            catch
            {

            }
        }